x86-16

assembly 8086 cursor placement

南笙酒味 提交于 2019-12-01 18:38:55
I want to place the cursor after the "paper:" wait until an ENTER is given and then place it after "author(s):". both sentences are defined variables that are printed. insert db "******* Insert new paper *******",0,0Ah,0Ah,0Ah, 0Dh, "$" inserttitle db " Title of paper: ",0Dh,0Ah,0Ah, " Name of author(s): ",0Dh ,"$" mainext db ,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah," <<Main>> <<Next>>","$" INSERT NEW PAPER newpaper proc call clrscr mov dx, offset insert call printf mov dx, offset inserttitle call printf mov dx, offset mainext call printf call w8click ret newpaper endp Jose Manuel Abarca Rodríguez

How does x86 real-mode segments overlap help memory saving?

爷,独闯天下 提交于 2019-12-01 18:09:40
问题 I'm teaching my 12 y.o. 8086 assembly language and yesterday we were talking memory, addressing and segmentation. I showed him how segments can be visualized as a sequence of overlapping 64Kb blocks starting on 16 byte boundaries, with the offset being an 8080-style pointer within a segment. Then he asked a question I could not answer: why (what for, with what purpose) do they overlap ? Trying to research this question I found many copies of the 20 bit math, and a few vague mentions of some

8086 assembly right mouse click interrupts

陌路散爱 提交于 2019-12-01 12:10:41
I am working on a project in 8086 assembly on windows machine and I need to know which mouse button has been clicked. What are the interrupts for this? or how do I go about finding this out? Thanks matja If you're making a DOS program that runs under windows, you can use software interrupt 0x33, function 3, which returns the button status in the BL register : mov ax,0x3 int 0x33 test bl,1 jnz left_button_pressed test bl,2 jnz right_button_pressed More info here http://www.ctyme.com/intr/rb-5959.htm If you're making a native Windows application, you can test for button presses by checking for

How to play chords in ASM 8086?

邮差的信 提交于 2019-12-01 11:40:02
I want to know what is the best way to play more then 1 note at the time in assembly. If you can, please add a procedure that explain your answer. Thanks! Orange, next code is a program a made long time ago in EMU8086 and Windows XP (it ran at that time). Now I have Windows 8 64 bits and it doesn't run anymore. I will give you the code because it may help you. All the names and comments are in spanish because I am costarrican, but the assembler code is universal (google translator will give you a hand): .model small .stack 100h .data ;-----------------------------------------------------------

How to play chords in ASM 8086?

一曲冷凌霜 提交于 2019-12-01 11:20:10
问题 I want to know what is the best way to play more then 1 note at the time in assembly. If you can, please add a procedure that explain your answer. Thanks! 回答1: Orange, next code is a program a made long time ago in EMU8086 and Windows XP (it ran at that time). Now I have Windows 8 64 bits and it doesn't run anymore. I will give you the code because it may help you. All the names and comments are in spanish because I am costarrican, but the assembler code is universal (google translator will

Invalid combination of opcode and operands? (x86 DOS) [duplicate]

▼魔方 西西 提交于 2019-12-01 10:13:24
问题 This question already has answers here : Why cannot do mov [eax], [ebx] [duplicate] (3 answers) Closed 8 months ago . org 100h mov ah, 9 mov dx, str1 mov byte [str1+2], [char] int 21h mov ah, 4Ch int 21h str1 db 'String$' char db "o" Why does NASM give me this error message: Error on line 5: Invalid combination of opcode and operands mov byte [str1+2], [char] in this line I'm trying to move the byte stored on *char to the address *str1+2 . 回答1: Intel architecture processors generally can't

8086 assembly right mouse click interrupts

依然范特西╮ 提交于 2019-12-01 09:56:15
问题 I am working on a project in 8086 assembly on windows machine and I need to know which mouse button has been clicked. What are the interrupts for this? or how do I go about finding this out? Thanks 回答1: If you're making a DOS program that runs under windows, you can use software interrupt 0x33, function 3, which returns the button status in the BL register : mov ax,0x3 int 0x33 test bl,1 jnz left_button_pressed test bl,2 jnz right_button_pressed More info here http://www.ctyme.com/intr/rb

Converting from lower case to upper case

空扰寡人 提交于 2019-12-01 09:26:37
I am trying to convert from lower case to upper case. I know it can easily be done by, SUB AL, 20H But I am have been given another solution which is, AND AL, 0DFH Please help me understand this. Thanks Look at the bit patterns: A (0x41): 0100 0001 a (0x61): 0110 0001 M (0x4d): 0100 1101 m (0x6d): 0110 1101 Z (0x5a): 0101 1010 z (0x7a): 0111 1010 Lower case ASCII is upper case ASCII + 0x20 ( 0010 0000 ) - i.e. the same bit pattern with the sixth bit set . 0xdf is 1101 1111 in binary. AND:ing AL with that will set the sixth bit to zero but preserve the other bit values. SUB AL, 20H is

Why does 20 address space with on a 16 bit machine give access to 1 Megabyte and not 2 Megabytes?

时间秒杀一切 提交于 2019-12-01 09:25:16
OK, this question sounds simple but I am taken by surprise. In the ancient days when 1 Megabyte was a huge amount of memory, Intel was trying to figure out how to use 16 bits to access 1 Megabyte of memory. They came up with the idea of using segment and offset address values to generate a 20 bit address. Now, 20 bits gives 2^20 = 1,048,576 locations that can be addressed. Now assuming that we access 1 byte per address location we get 1,048,576/(1024*1024) = 2^20/2^20 Megabytes = 1 Megabyte. Ok understood. The confusion comes here, we have 16 bit data bus in the ancient 8086 and can access 2

Parity of a number (Assembly 8086)

与世无争的帅哥 提交于 2019-12-01 08:09:45
Im trying to give a one digit number, and know if the parity is odd or even, for example, give 9 and print that is an odd number. This is what I have: assume cs:cseg,ds:dseg,ss:sseg cseg segment start: mov ax, dseg mov ds, ax mov ah, 01h ; Here, im adding a number int 21h jp even jnp odd even: mov ah,09 lea dx,par int 21h jmp exit odd: mov ah,09 lea dx,odd1 int 21h jmp salir salir: mov ax,4C00h int 21h cseg ends dseg segment byte even Db 'Even number$' odd11 Db 'Odd number$' dseg ends sseg segment stack db 100h dup(?) sseg ends end start Thanks! And sorry for my bad english. To test if a