emu8086

assembly 8086 cursor placement

丶灬走出姿态 提交于 2019-12-19 21:42:08
问题 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

Random number in assembly

牧云@^-^@ 提交于 2019-12-17 17:01:27
问题 I am new to assembly and would like to know how to write a program in EMU8086 that prints a different random number in every run of it. Is it possible to do it without using interrupts? 回答1: If you were using a real version of DOS (not EMU8086) @fuz method is the way you can do it, and it doesn't require interrupts. You just read the lower 16-bits of the 32-bit value at memory address 0x46c (0x00040:0x006c) in the BIOS Data Area(BDA). The value at that location is a 32-bit value representing

How to count the occurence of specific characters in a string in emu8086

痴心易碎 提交于 2019-12-14 03:36:15
问题 Please. .kindly help me on this problem. . Output: Enter string: already A - 2 B - 0 C - 0 D - 1 E - 1 回答1: Write a procedure that loops over the entire string in search of a specific character. For each match increment a counter. Upon return display the result as character DL occurs DH times : e.g. "A - 2". mov dl, "A" call CountChar ... print result ... mov dl, "B" call CountChar ... print result ... CountChar: mov dh, 0 mov cx, ... length of the input string ... jcxz Ready mov bx, ...

Sort an array with emu8086 (Assembler)

你离开我真会死。 提交于 2019-12-13 21:28:31
问题 I have to type and array (only with numbers) and when a introduce it, it must be sorted in a second one. All I have to do is to implement the PROC which has to sort them. My problem is that I don't know how, because the only thing I have achieved is to copy the first one into the second one. Thanks for your help and sorry for my English. ;mov ax, vector[si] ;mov vector[di], ax ;this loop copy all elements ; start code Sort_DecreasingOrder: cmp si, 0 mov ax, vector1[si] bCompare: xor di, di

Input is to be taken from a-z or A-Z. We need to have the first and last Capital letters of that input string as the output

泪湿孤枕 提交于 2019-12-13 11:15:16
问题 Input is to be taken from a-z or A-Z and the input ends when we give a star(*). We need to have the first and last Capital letters of that input characters as the output. also, we should show the input we have taken each time. N.B. We take the inuputs character by character, not as a string. Test case 1: input: aAbCcP* output: AP Test case 2: input: ZabCBc* output: ZB 回答1: $test1="aAbCcP*"; $test="ZabCBc*"; $i=0; $a=[]; $final_string=""; while(!empty($test[$i])){ if(ctype_upper($test[$i])){

Printing array — getting strange output (emu8086)

不羁的心 提交于 2019-12-12 02:45:30
问题 My question is related to printing an array in assembly 8086 language. I use 'emu8086' program. The following piece seems fine to me (I'm a beginner), yet the result I get is: *P000, instead of: 12345. Main: A DB 1,2,3,4,5 //my array SUB SI, SI //SI stands for counter and index here LEA BX, A loop3: MOV DX, [BX + SI] ADD DX, 30h //converting digit into character MOV Ah, 2h int 21h //displaying the character in console window INC SI CMP SI, 5 JNE loop3 end Main Can you, please, explain what's

Assembly emu8086, reversing a string

对着背影说爱祢 提交于 2019-12-11 07:15:22
问题 I am trying to make a program where the user have to enter a string and get an reversed output. Moreover, it should change all lowercase letters to uppercase and uppercase to lowercase. I've already done program where you can enter 1 character. My next goal is to get as many characters as I want. I did some research and came up with this code: org 100h include emu8086.inc .DATA STR1 DB 0DH,0AH, 'Input: $' STR2 DB 0DH,0AH, 'Output: $' nl db 0dh,0ah,'$' .CODE START: MOV AX, @DATA MOV DS, AX cmp

Why is My printing in assembly not printing characters after the 26th line?

空扰寡人 提交于 2019-12-11 05:25:40
问题 I'm pretty much learning Assembly and succeeded in working out my problem in printing here Now I have another question. I'm using emu8086. I have this code print an image of a minion in bits using the space character with background color. I managed to make it print the image per line but when it reached the 26th line, it stopped printing and there is this error of "wrong interrupt". Can anyone help me. Here is the entire code: org 100h name "charchar" org 100h ;buhok line 1 (Grey) mov ax

Generating random numbers in assembly

∥☆過路亽.° 提交于 2019-12-10 16:12:28
问题 I am new to assembly, and I am having problems generating random numbers. My code is simple: it generates 100 numbers in the 0-25 range and stores them in an array. The problem I am experiencing is that when I run the con on the emu8086 assembler it runs successfully and generates 100 random numbers, that are stored in the array. But when I run it on the masm611 , it generates a new random number every 4 cycles. Which means the values in the array are consecutive same number for 4 values and

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