x86-16

How to compute the result of 8086 IDIV instruction?

一个人想着一个人 提交于 2019-12-12 18:22:13
问题 Instructions (numbers in hex): mov ax, 0832 mov cx, 008a idiv cl Documentation says: when operand is a byte: AL = AX / operand AH = remainder (modulus) Source: http://www.electronics.dit.ie/staff/tscarff/8086_instruction_set/8086_instruction_set.html#IDIV As far as I understand, I have to check if the leftmost bit isn't 1: 0832 -> 0000.1000.0011.0010 008a -> 0000.0000.1000.1010 Since there's no 1's in highest bits, by using calculator I should get: 0832 mod 008a as remainder and 0832 div 008a

Relative jump out of range by 0020h bytes

五迷三道 提交于 2019-12-12 16:24:03
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I had been trying to write a basic com file for a 'shell'. I was able to assemble the same code in NASM with little modifications. However this code won't assemble in TASM ! I get errors of the kind : Relative jump out of range I looked up a little on Google to find out about jumps. However I could not find much, except the idea to break this jump into

Hooking Int 09h interrupt

ⅰ亾dé卋堺 提交于 2019-12-12 14:52:29
问题 I have a problem hooking int 09h I've changed the pointer to my new Isr, if I debug on windows, the interrupt is triggered every time I push a key. But in VMWare it seems that only is triggered one time and no more. I've tested in DOS 6.22 and happens exactly the same. My code look like this: MyIsr: pusha pushf ;tell PIC that interrupt has finished mov al,0x20 out 0x20,al popf popa iret If I use a USB keyboard can I send the same commands like Ps/2? 回答1: There could be a number of issues here

I'm trying to use the stored value in AX after the AAM instruction to divide it by 2, Why it doesn't work with 2 digits numbers output?

痴心易碎 提交于 2019-12-12 13:26:32
问题 English is not my native language; please excuse typing errors, the code I will show here is a homework. I really need to understand what's going on. I'm using Intel 8086 syntax, in DosBox 0.74 and TASM assembler. The problem with the code is in the Area of the Triangle when I have to divide by 2. Note: the program always read only 1 digit from the keyboard. Look at the code (a user here suggested to show all my code instead of show it by part, I think is a bit long, but I think he is right,

a good 8086 emulator [closed]

≯℡__Kan透↙ 提交于 2019-12-12 12:18:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . is there a 8086 emulator for mac. If yes, which is the best 回答1: Unless you need real raw 8086 (with custom OS) you should try: DosBox! Works nice for me! 回答2: What about this one? It's cross-platform and seems quite easy to use.. I suppose it's programmed with ncurses.. 回答3: Try QEMU. It is easily intalled via

Importance of Hexadecimal numbers in Computer Science [closed]

心不动则不痛 提交于 2019-12-12 07:23:45
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . When studying programming 8085, 8086 and microporcessors in general we always have hexadecimal representation. Its ok that binary numbers are important in computers. But how these hexadecimal numbers are important? Any historical importance? It would be nice if someone point to

Assembly language 8086

做~自己de王妃 提交于 2019-12-12 06:48:04
问题 I've a problem with Assembly 8086. I don't know how to use an 2D array. When I m using like this mov ar[cx][dx] I get an error, and when I want to us SI and DI in an array it also returns an error. 回答1: I would be very impressed in a CPU that provided array lookup semantics in its assembly language. Or rather, I would be annoyed if it meant something more important had been sacrificed. The general way to do array lookup in assembly is by doing the calculation yourself to turn the two indexes

JMP vs. CALL in 8086 assembly

偶尔善良 提交于 2019-12-12 05:37:38
问题 Can I use JMP and RET to jump back from a label as you would with CALL and RET ? 回答1: When you use CALL the current value of the instruction pointer is saved on the stack...when the corresponding RET executes, it takes the address from the stack and jumps there. If you just JMP without saving the current address on the stack the corresponding RET will, unsurprisingly, not find a correct address where it expects one. It will probably find some data, nevertheless, it will try to jump to the

What is the longest byte instruction possible in 8088?

北城余情 提交于 2019-12-12 03:41:08
问题 I'm making a minimalistic assembler for 8088. I would like to know what is the longest possible byte instruction combination? At the moment, the longest instruction I found is 6 bytes.: add word [0134], 0032 which translates to 81 06 34 01 32 00 Is there anything longer than 6 bytes? Also a Sidequestion, I understand the whole 6 bytes completely except for the 4th byte. like for example: 1st byte means: add with 16bit of immediate data 2nd byte means: Base pointer + displacement command 3rd

How to make “local” the label in a 8086 procedure?

时光怂恿深爱的人放手 提交于 2019-12-12 03:36:42
问题 The problem is that some (many) labels have the same name, in particular: there are many procedures and each works properly if run "isolated" from the others. In fact, the labels used in different procedures have all the same common names such as "skip", "cycle", and so on. I know that in the macros could be used the directive LOCAL <label1>, <label2>, ... . But this directive doesn't work into a procedure. Changing each label is very boring, but not impossible to do, the real problem is that