x86-16

Pointers and Indexes in Intel 8086 Assembly

孤者浪人 提交于 2019-12-08 04:25:59
问题 I have a pointer to an array, DI. Is it possible to go to the value pointed to by both DI and another pointer? e.g: mov bl,1 mov bh,10 inc [di+bl] inc [di+bh] And, on a related note, is there a single line opcode to swap the values of two registers? (In my case, BX and BP?) 回答1: For 16-bit programs, the only supported addressing forms are: [BX+SI] [BX+DI] [BP+SI] [BP+DI] [SI] [DI] [BP] [BX] Each of these may include either an 8- or 16-bit constant displacement. (Source: Intel Developer's

The output is not displayed in its entirety [8086 assembly]

女生的网名这么多〃 提交于 2019-12-08 03:30:57
问题 ;The number of repetition of each character in the string .MODEL small .STACK 100h .DATA msg3 db 13,10,'Enter a string up to 200 characters:$' msg4 db ' $' msg5 db 13,10,'Hit any key to exit',13,10,'$' crlf db 13,10,'$' char db 0 repet db 0 mone1 dw 0 mone2 dw 0 dig1 db 0 dig2 db 0 dig3 db 0 arr db 256 dup(0) str db 200 strlen db 0 strtxt db 200 dup(0) .CODE mov AX,@data mov DS,AX call GetString call UpdateArr call Repetitions call EndProject GetString: lea DX,msg3 ;Show msg3 on screen mov AH

How to copy from one file to another?

此生再无相见时 提交于 2019-12-08 02:09:52
问题 I am trying to copy from one file to another. So if the user is prompted to enter a file name...FILE1 a saved string will be copied to a file then the user is prompted to enter a second file name...File2, the contents of file 1 is copied to file 2. I can find information on the read part but I'm not sure how to copy from 1 to the other??? .model small .stack 100h .data handle dw ? filename db 26 ;MAX NUMBER OF CHARACTERS ALLOWED (25). db ? ;LENGTH (NUMBER OF CHARACTERS ENTERED BY USER). db 26

Pointers and Indexes in Intel 8086 Assembly

我的梦境 提交于 2019-12-07 23:58:33
I have a pointer to an array, DI. Is it possible to go to the value pointed to by both DI and another pointer? e.g: mov bl,1 mov bh,10 inc [di+bl] inc [di+bh] And, on a related note, is there a single line opcode to swap the values of two registers? (In my case, BX and BP?) Zooba For 16-bit programs, the only supported addressing forms are: [BX+SI] [BX+DI] [BP+SI] [BP+DI] [SI] [DI] [BP] [BX] Each of these may include either an 8- or 16-bit constant displacement. (Source: Intel Developer's Manual volume 2A , page 38) The problem with the example provided is that bl and bh are eight-bit

Assembly Basics: Output register value

狂风中的少年 提交于 2019-12-07 20:59:00
问题 I just started learning assembly language and I am already stuck on the part to "display the decimal values stored in a register on the screen". Im using the emu8086, any help would be appreciated! :) .model small ;Specifies the memory model used for program to identify the size of code and data segments org 100h ;allocate 100H memory locations for stack .data ;the segment of the memory to declare/initialze the variables var1 db 0006 var2 db 0002 var3 db 0001 .code ;start of the code segment

The output is not displayed in its entirety [8086 assembly]

那年仲夏 提交于 2019-12-07 18:09:26
;The number of repetition of each character in the string .MODEL small .STACK 100h .DATA msg3 db 13,10,'Enter a string up to 200 characters:$' msg4 db ' $' msg5 db 13,10,'Hit any key to exit',13,10,'$' crlf db 13,10,'$' char db 0 repet db 0 mone1 dw 0 mone2 dw 0 dig1 db 0 dig2 db 0 dig3 db 0 arr db 256 dup(0) str db 200 strlen db 0 strtxt db 200 dup(0) .CODE mov AX,@data mov DS,AX call GetString call UpdateArr call Repetitions call EndProject GetString: lea DX,msg3 ;Show msg3 on screen mov AH,09h int 21h lea DX,str ;Accept a string mov AH,0ah int 21h lea DX,crlf ;New line for the output mov AH

Interchange Letters From String in Assembly Language 8086

萝らか妹 提交于 2019-12-07 15:28:55
问题 I have a very simple problem that i need to achieve. First you enter a string, the first output should copy the last letter of the string and replace the first letter of the string and then the last letter should be replace with the first letter. The second output should capitalize the first letter of the string. I've already did the second output, my problem now is the first output. Please see the expected result below. Expected Result Enter string: jon jones son jonej Jon jones Current Code

Moving data from memory to memory in micro controllers

只谈情不闲聊 提交于 2019-12-07 12:22:53
问题 Why can't we move data directly from a memory location into another memory location. Pardon me if I am asking a dumb question, but I think this is a true situation, at least for the ones I've encountered (8085,8086 n 80386) I am not really looking for a solution for moving the data (like for eg, using movs n all), but actually the reason for this anomaly. 回答1: Most CPU varieties don't allow memory-to-memory moves. Normally the CPU can access only one memory location at at time, which means

Change the background color of dosbox console when executing a tasm program

眉间皱痕 提交于 2019-12-07 11:03:57
问题 I am trying to display x in the center of the screen and then change the background color of the console to blue. I have the following code that accomplishes everything except for changing the background color: TITLE screen1.ASM .MODEL SMALL .STACK 0100h .DATA .CODE start: MOV AX,@DATA MOV DS,AX MOV AX,0600h MOV BH,07h MOV CX,0000h MOV DX,184Fh INT 10h MOV AH,02h MOV BH,00h MOV DH,0Ch MOV DL,28h INT 10h MOV AH,02h MOV DL,'x' INT 21h MOV AX,4C00h INT 21h END start The code clears the screen,

how to change flags manually (in assembly code) for 8086?

前提是你 提交于 2019-12-06 19:47:32
Is there any way to change every flag manually? Or do you have to use a command with a result that you know will change them? Basically I'm working with the command RCL , and I don't want to get 1 at the begining, so I want to change the CF to 0, and I know that I can use commands like: mov al, 0 shl al, 1 But I want to know if there is any other way to do that, without the use of another commands result. I would also want to know whether the way you may show me, can also be used to change all of the flags, not only CF, but OF, ZF, and so on. There isn't any instruction that treat eflags as