dos

Can't get output of assembly language code

别说谁变了你拦得住时间么 提交于 2021-02-16 20:30:17
问题 I am newbie in assembly language. I am trying to get a string of numbers from user terminated by Enter or the length of the string reaching 20. When I executed the program it didn't show any error, but neither did it show any output nor did it terminate when the string exceeded the 20 characters limit. My code is: .model small .stack 100h .data var1 db 100 dup('$') .code main proc mov ax, @data mov dx, ax mov si, offset var1 l1: mov ah, 1 int 21h cmp al,20 je programend mov [si], al inc si

Can't get output of assembly language code

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-16 20:29:06
问题 I am newbie in assembly language. I am trying to get a string of numbers from user terminated by Enter or the length of the string reaching 20. When I executed the program it didn't show any error, but neither did it show any output nor did it terminate when the string exceeded the 20 characters limit. My code is: .model small .stack 100h .data var1 db 100 dup('$') .code main proc mov ax, @data mov dx, ax mov si, offset var1 l1: mov ah, 1 int 21h cmp al,20 je programend mov [si], al inc si

How to input from user number more than one digit in assembly?

懵懂的女人 提交于 2021-02-16 17:54:35
问题 I need to find an interrupt that can receive from a user a number with more than 1 digit. ;code mov [0],0 mov si,0 lop: mov ah,1 int 21h cmp al,'q' je finishedInput xor ah,ah add [word ptr si], ax jmp lop finishedInput: I have already tried to do an end less loop that each time uses the mov ah,1 int 21h combination until the user press 'q' and the endless loop will stop and. However, I am almost convinced that I have seen a code that do the same thing with interrupt instead. I want to stop

In a batch file, how do I get a file name from a file path?

百般思念 提交于 2021-02-16 14:36:09
问题 I have a batch file that requires the user to enter a file path. Later on in the file I want to isolate just the filename and extention from the path, ie anything after the last '\'. set FILEPATH=\\srv-01\My Docs\Templates\My SpreadSheet.xls ... set FILENAME=??? What do i need to set FILENAME to in order for it to equal 'My SpreadSheet.xls'? Hopefully this is fairly simple to do. Thanks! 回答1: @echo off set FILEPATH=\\srv-01\My Docs\Templates\My SpreadSheet.xls for /F "delims=" %%A in ("

DosBox is buggy with int 15h ah = 86h

你。 提交于 2021-02-11 08:46:36
问题 I am currently working on an assembly program, but I need to make the program wait every once in a while. So, I have been using int 15h/ah = 86h, but for some reason DosBox is giving me a hard time, and the program either gets confused with pixels (wierd colors) or in the worse case; crash. Can someone please help me? 回答1: I had this issue as well. Based on the answer at Problems with BIOS delay function (INT 15h / AH = 86h), I was able to get it working by making sure to set AL to zero

DosBox is buggy with int 15h ah = 86h

无人久伴 提交于 2021-02-11 08:46:11
问题 I am currently working on an assembly program, but I need to make the program wait every once in a while. So, I have been using int 15h/ah = 86h, but for some reason DosBox is giving me a hard time, and the program either gets confused with pixels (wierd colors) or in the worse case; crash. Can someone please help me? 回答1: I had this issue as well. Based on the answer at Problems with BIOS delay function (INT 15h / AH = 86h), I was able to get it working by making sure to set AL to zero

Converting decimal to binary in assembler

好久不见. 提交于 2021-02-05 12:17:25
问题 I need help with my first program in assembler. I have to convert values entered by user from decimal to binary. I have no idea how can I show values as a decimal, and what should I do next. could anyone instruct me step by step what do next. .model small .stack 100h` .data txt1 db "Enter binary value:" ,10,13, "$" txt2 db "BIN: " ,10,13, "$" .code main proc mov ax, @data mov ds, ax ;clear screen mov ah,0fh int 10h mov ah,0 int 10h ;show first text mov ah, 9 mov dx, offset txt1 int 21h call

Converting decimal to binary in assembler

不打扰是莪最后的温柔 提交于 2021-02-05 12:16:31
问题 I need help with my first program in assembler. I have to convert values entered by user from decimal to binary. I have no idea how can I show values as a decimal, and what should I do next. could anyone instruct me step by step what do next. .model small .stack 100h` .data txt1 db "Enter binary value:" ,10,13, "$" txt2 db "BIN: " ,10,13, "$" .code main proc mov ax, @data mov ds, ax ;clear screen mov ah,0fh int 10h mov ah,0 int 10h ;show first text mov ah, 9 mov dx, offset txt1 int 21h call

DOS assembly read two succeeding characters, and convert to number

[亡魂溺海] 提交于 2021-02-05 08:17:26
问题 I'm writing a simple program that takes in two numbers between 1-99, adds them and prints out the result. I'm done with the printing part, I can print up too three digits, 99+99=198 so it's enough for this program. I have the program working for two one digit numbers. Example: 1 1 = 2 , 4 4 = 8 So the digits is separated by spaces. Now I need the following; 11 1 = 12, 1 45 = 46 what I got so far, when I first read a valid number i store it on the stack while I check what the next char is, if

Converting bin to hex in assembly

▼魔方 西西 提交于 2021-02-02 03:42:30
问题 I'm beginner and I need help with converting 16-bit binary number to hex. I have done most of the code, but I need help with a couple of things. How to make it only accept 0 and 1 in input and ignore the rest of numbers and letters? After conversion process I'm getting wrong number in hex. What did I do wrong? Example input: 1010101111001101 Expected output: ABCD Current output: AAAC Here's my code: .MODEL SMALL .STACK 1000h .DATA title db 'Convert BIN to HEX:.',13,10,'$' HEX_Map DB '0','1',