emu8086

Computing the factorial of 10 using 8086 assembly

寵の児 提交于 2021-02-05 10:43:06
问题 I have been trying to solve this using assembly language. The thing is I cannot store the 10! In al and my code works for finding factorial of 5. How do I store my result of 10! In a register? When I find factorial of 5 I can see the result clearly in al because 120 can be stored in al . Any help would be appreciated. Here's my code for 5! org 100h .DATA ANS DB ? .CODE MAIN PROC MOV AX,@DATA MOV DS,AX MOV AL,5 MOV CL,4 MOV BL,AL SUB BL,1 L: MUL BL SUB BL,1 LOOP L MOV ANS,AL END MAIN ret 回答1:

Why is the variable name “name” not allowed in assembly 8086?

China☆狼群 提交于 2021-02-05 06:04:22
问题 When I try to declare a variable with the name "name" it doesn't work, it gives me an error, this one there are errors. with the following explanation (22) wrong parameters: MOV BL, name (22) probably no zero prefix for hex; or no 'h' suffix; or wrong addressing; or undefined var: name here is my code ; multi-segment executable file template. data segment ; add your data here! pkey db "press any key...$" name db "myname" ends stack segment dw 128 dup(0) ends code segment start: ; set segment

How to convert an 8086 emu assembly program to linux assembly comaptible

点点圈 提交于 2021-01-29 14:17:12
问题 I am writing a code to convert hex (A-F) to decimal in assembly. I managed to write it on 8086 emu but I need it for linux. I need help. The code works absolutely fine on 8086 emulator n windows. But I am unable to convert it into Linux syntax. I am not familiar with the Linux Syntax for assembly. This is my 8686 code. org 100h .model small .stack 100h .data msg1 db 'Enter a hex digit:$' msg2 db 'In decimal it is:$' .code main proc mov ax,@data mov ds,ax lea dx,msg1 mov ah,9 int 21h mov ah,1

Incorrect value of the variable ans that stores the LCM of two numbers (8086 Program)

社会主义新天地 提交于 2021-01-05 12:47:21
问题 Following is the code I wrote to find LCM of two numbers in EMU8086. When I ran it, I am getting value 0 in the Ans variable. .MODEL SMALL .DATA Num1 DW 250 Num2 DW 100 Ans DW ? .CODE MOV AX,@DATA MOV DS, AX MOV AX, Num1 MOV BX, Num2 MOV DX, 0000h NEXT: PUSH AX PUSH DX DIV BX CMP DX, 0000h JZ LAST POP DX POP AX ADD AX, Num1 JNC NEXT INC DX JMP NEXT LAST: POP Ans+2 POP Ans MOV AH, 4Ch INT 21h END 回答1: LCM(a, b) = a * b / GCD(a, b) Due to this equation, you can find GCD using Euclid's algorithm

Incorrect value of the variable ans that stores the LCM of two numbers (8086 Program)

柔情痞子 提交于 2021-01-05 12:45:03
问题 Following is the code I wrote to find LCM of two numbers in EMU8086. When I ran it, I am getting value 0 in the Ans variable. .MODEL SMALL .DATA Num1 DW 250 Num2 DW 100 Ans DW ? .CODE MOV AX,@DATA MOV DS, AX MOV AX, Num1 MOV BX, Num2 MOV DX, 0000h NEXT: PUSH AX PUSH DX DIV BX CMP DX, 0000h JZ LAST POP DX POP AX ADD AX, Num1 JNC NEXT INC DX JMP NEXT LAST: POP Ans+2 POP Ans MOV AH, 4Ch INT 21h END 回答1: LCM(a, b) = a * b / GCD(a, b) Due to this equation, you can find GCD using Euclid's algorithm

EMU8086 dividing 32 bit number by a 16 bit number gives unexpected 0 remainder

天大地大妈咪最大 提交于 2021-01-03 07:07:52
问题 I was trying to divide (Unsigned) 8A32F4D5 by C9A5 using emu8086 tool. I expected the quotient to be AF73H and the remainder be 94B6H . After writing the following code, I was getting correct quotient but the remainder became 0000h . Am I missing something? .MODEL SMALL .STACK 100H .DATA .CODE MAIN PROC ; initialize DS MOV AX,@DATA MOV DS,AX ; enter your code here MOV DX, 8A32H MOV AX, 0F4D5H MOV BX, 0C9A5H DIV BX ;exit to DOS MOV AX,4C00H INT 21H MAIN ENDP END MAIN The output in EMU8086: 回答1

EMU8086 dividing 32 bit number by a 16 bit number gives unexpected 0 remainder

蓝咒 提交于 2021-01-03 07:04:46
问题 I was trying to divide (Unsigned) 8A32F4D5 by C9A5 using emu8086 tool. I expected the quotient to be AF73H and the remainder be 94B6H . After writing the following code, I was getting correct quotient but the remainder became 0000h . Am I missing something? .MODEL SMALL .STACK 100H .DATA .CODE MAIN PROC ; initialize DS MOV AX,@DATA MOV DS,AX ; enter your code here MOV DX, 8A32H MOV AX, 0F4D5H MOV BX, 0C9A5H DIV BX ;exit to DOS MOV AX,4C00H INT 21H MAIN ENDP END MAIN The output in EMU8086: 回答1

EMU8086 dividing 32 bit number by a 16 bit number gives unexpected 0 remainder

不羁岁月 提交于 2021-01-03 07:04:33
问题 I was trying to divide (Unsigned) 8A32F4D5 by C9A5 using emu8086 tool. I expected the quotient to be AF73H and the remainder be 94B6H . After writing the following code, I was getting correct quotient but the remainder became 0000h . Am I missing something? .MODEL SMALL .STACK 100H .DATA .CODE MAIN PROC ; initialize DS MOV AX,@DATA MOV DS,AX ; enter your code here MOV DX, 8A32H MOV AX, 0F4D5H MOV BX, 0C9A5H DIV BX ;exit to DOS MOV AX,4C00H INT 21H MAIN ENDP END MAIN The output in EMU8086: 回答1

Change the color with the user option

淺唱寂寞╮ 提交于 2020-07-09 11:52:07
问题 I'm working in my project with assembly emu8086 and I've done a lot of things: Now I'm struggling to put the option selected by the user. I want to change the leds color from (0-7) using the user option, I've already done a lot of things I only dont understand how I'll do this to change the color, if the user select 1 both squares(leds) need to change to blue and this for all the colors, I need to verify the user option. Here is my code: title ac-cores-mov-cursor.asm - desenha poligno