emu8086

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

Assembly random numbers generator

我怕爱的太早我们不能终老 提交于 2019-12-07 07:11:36
问题 I am using assembly 8086emu and I need a numbers generator for 8 numbers. I tried to use this piece of code by @johnfound: RANDGEN: ; generate a rand no using the system time RANDSTART: MOV AH, 00h ; interrupts to get system time INT 1AH ; CX:DX now hold number of clock ticks since midnight mov ax, dx xor dx, dx mov cx, 10 div cx ; here dx contains the remainder of the division - from 0 to 9 add dl, '0' ; to ascii from '0' to '9' mov ah, 2h ; call interrupt to display a value in DL int 21h

DosBox how to fix character attribute?

纵饮孤独 提交于 2019-12-06 09:42:55
I wrote my assembly code just to write a character with a blue background and white foreground. It works in emu8086's emulator but when I open it on DosBox it does not show the background color. With Emu8086: With DosBox: mov ax,0012h int 10h mov ah,9 mov al,31h mov bl,1fh int 10h In the graphics video modes, the BL parameter for BIOS function 09h only defines the foreground color. It is always applied to a black background. Below is my implementation of an extension of the functionality of this function. Now BL holds an attribute (foreground color and background color) just like in the text

Assembly Basics: Output register value

核能气质少年 提交于 2019-12-06 08:06:06
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 main proc ;start of the first procedure mov bl, var1 add bl, var2 add bl, var3 mov ah, 00h ; display

How to make a new line and print the same characters in new line

有些话、适合烂在心里 提交于 2019-12-02 19:37:51
问题 I'm trying to learn assembly. I saw this example in printing "Hello World!(red text) with a backgound color(yellow)" I managed to edit the code to just print spaces with yellow background by trial and error. However I cannot print a new line. if I add a new mov [200], ' ' for example (dont know if this is correct) it adds a character on a different line but a different color.. if I add 00010001b after the comma if prints a different color which should blue. can anyone give me a head start

Assembly segment declaration syntax

帅比萌擦擦* 提交于 2019-12-02 13:28:27
问题 I just started with ASM, and x8086 architecture, and I'm having certain issues following up with some of the examples that come with emu8086. SSEG SEGMENT STACK 'STACK' DW 100h DUP(?) SSEG ENDS Okay SSeg , I guess that it's a label to be the stack segment, the SEGMENT keyword to indicate that ahead comes a segment, but what does STACK 'STACK' stand for? And below, I think it means "Allocate (I don't know where) 100h 16 bit words, without values" Is this correct and if so, where is it

How to make a new line and print the same characters in new line

*爱你&永不变心* 提交于 2019-12-02 08:04:02
I'm trying to learn assembly. I saw this example in printing "Hello World!(red text) with a backgound color(yellow)" I managed to edit the code to just print spaces with yellow background by trial and error. However I cannot print a new line. if I add a new mov [200], ' ' for example (dont know if this is correct) it adds a character on a different line but a different color.. if I add 00010001b after the comma if prints a different color which should blue. can anyone give me a head start tutorial in this code. I just want to print another line for now.. Here is the working code so far.. it

Why am I getting zero from mov ax, bx+si+1?

做~自己de王妃 提交于 2019-12-02 02:23:51
问题 mov ax,10 mov bx,4 mov si,ax mov ax,bx+si+1 LEA ax,[bx+si+1] When I add bx,si and 1 together and move to ax , the result is 0. At the next line, when I use LEA it works and I get 15. Why am I getting zero when using move? 回答1: Your question is : "Why am I getting zero from mov ax, bx+si+1?". It's hard to give you an accurate answer because you forgot to tell what compiler you are using and your code snippet doesn't include the data segment so we can't see your data. What we can do is to test

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