x86-16

What is the best way to move an object on the screen?

筅森魡賤 提交于 2019-11-26 12:32:41
I wanted to know what is the best way for moving an object on the screen- for expample: if some kind of shape presented on the screen(on graphic mode), I would like to move it left and right using the keyboard's arrows keys. I know how to read the keyboard buffer. The important thing is that I would like to know is how to move something smooth on the screen. I'm using DOS-Box, with 8086 architecture. And the movment must be on graphic mode (320X200). OK finally got TASM+TLINK to work with W7 x64 ... (VirtualPC is not working Properly anymore :() So here is one simple Tuneler like game for 3

Why can't MOV have both operands as memory locations? [closed]

我是研究僧i 提交于 2019-11-26 09:14:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I read that MOV instruction cannot have memory locations for both its operands. Like : MOV [0012H], [0016H] is not allowed. Why so?

NASM x86 16-bit addressing modes

 ̄綄美尐妖づ 提交于 2019-11-26 08:57:35
I am having trouble with pointing to a address and write in my case a variable of byte in size. This gives me the error "error: invalid effective address": mov byte[AX], byte 0x0 After some trail and error i tested the same but with EAX. This compiles just fine: mov byte[EAX], byte 0x0 What am I missing here? Alexey Frunze [AX] is an invalid memory operand specification. The valid 16-bit ones are : [constant] [BX] [SI] [DI] [BX+constant] [BP+constant] [SI+constant] [DI+constant] [BX+SI] [BX+DI] [BP+SI] [BP+DI] [BX+SI+constant] [BX+DI+constant] [BP+SI+constant] [BP+DI+constant] [BP] is formally

How do I disassemble raw 16-bit x86 machine code?

懵懂的女人 提交于 2019-11-26 06:13:47
问题 I\'d like to disassemble the MBR (first 512 bytes) of a bootable x86 disk that I have. I have copied the MBR to a file using dd if=/dev/my-device of=mbr bs=512 count=1 Any suggestions for a Linux utility that can disassemble the file mbr ? 回答1: You can use objdump. According to this article the syntax is: objdump -D -b binary -mi386 -Maddr16,data16 mbr 回答2: The GNU tool is called objdump , for example: objdump -D -b binary -m i8086 <file> 回答3: I like ndisasm for this purpose. It comes with

What&#39;s the purpose of the LEA instruction?

不羁的心 提交于 2019-11-26 05:40:12
问题 For me, it just seems like a funky MOV. What\'s its purpose and when should I use it? 回答1: As others have pointed out, LEA (load effective address) is often used as a "trick" to do certain computations, but that's not its primary purpose. The x86 instruction set was designed to support high-level languages like Pascal and C, where arrays—especially arrays of ints or small structs—are common. Consider, for example, a struct representing (x, y) coordinates: struct Point { int xcoord; int ycoord

Assembly 8086 | Sum of an array, printing multi-digit numbers

落花浮王杯 提交于 2019-11-26 04:55:56
问题 I\'ve written a pretty simple code in asm x8086 and I\'m facing an error. If anyone could help me with a brief explanation I would greatly appreciate it. IDEAL MODEL small STACK 100h DATASEG ; -------------------------- array db 10h, 04h, 04h, 04h, 04h, 04h, 04h, 04h, 04h, 04h sum db 0 ; -------------------------- CODESEG start: mov ax, @data mov ds, ax ; -------------------------- xor cx, cx mov al, 0 mov bx, offset array StartLoop: cmp cx, 10 jge EndLoop add al, [bx] add [sum],al inc cx inc

8086 assembly on DOSBox: Bug with idiv instruction?

那年仲夏 提交于 2019-11-26 02:21:29
I was helping a friend of mine debug his program, and we narrowed it down to an issue which occurs even here: .MODEL small .STACK 16 .CODE start: mov ax, 044c0h mov bl, 85 idiv bl exit: mov ax, 4c00h int 21h end start After assembling it with tasm 4.1, and running it on DOSBox 0.74, it goes into an infinite loop. When inspecting it with turbo debugger one can see it happens after the idiv instruction, which for some reason modifies the cs and ip registers, and after two seemingly random instructions restores them to point to the idiv line, executing it again ad infinitum. Does anyone have any

NASM x86 16-bit addressing modes

∥☆過路亽.° 提交于 2019-11-26 01:49:58
问题 I am having trouble with pointing to a address and write in my case a variable of byte in size. This gives me the error \"error: invalid effective address\": mov byte[AX], byte 0x0 After some trail and error i tested the same but with EAX. This compiles just fine: mov byte[EAX], byte 0x0 What am I missing here? 回答1: [AX] is an invalid memory operand specification. The valid 16-bit ones are: [constant] [BX] [SI] [DI] [BX+constant] [BP+constant] [SI+constant] [DI+constant] [BX+SI] [BX+DI] [BP

8086 assembly on DOSBox: Bug with idiv instruction?

断了今生、忘了曾经 提交于 2019-11-26 01:47:49
问题 I was helping a friend of mine debug his program, and we narrowed it down to an issue which occurs even here: .MODEL small .STACK 16 .CODE start: mov ax, 044c0h mov bl, 85 idiv bl exit: mov ax, 4c00h int 21h end start After assembling it with tasm 4.1, and running it on DOSBox 0.74, it goes into an infinite loop. When inspecting it with turbo debugger one can see it happens after the idiv instruction, which for some reason modifies the cs and ip registers, and after two seemingly random

Boot loader doesn&#39;t jump to kernel code

浪尽此生 提交于 2019-11-25 22:24:42
问题 I\'m writing small operation system - for practice. I started with bootloader. I want to create small command system that runs in 16 bit real mode (for now). I\'ve created bootloader that resets drive, then loads sector after bootloader. The problem is because after jmp function nothing actually happening. I\'t trying to load next sector at 0x7E00 (I\'m not totally sure how to point address using es:bx so that may be a problem, I believe that its Address:offset), just after bootloader. This