tasm

TASM checking arguments when cx is modified

时光怂恿深爱的人放手 提交于 2019-12-13 02:59:50
问题 I need to check whether good amount of arguments is given. Currently my program knows when there are no arguments and when there are more than two arguments given. If one is given, then it is bad, but my program doesn't recognise it. I can't do simple check because there is one possibility when it is allowed (when /? is argument) and cx changes with loop. For example, if I call it prog /?, it should print description, when I call it prog arg1 arg2, it should be allowed, but prog arg1 shouldn

8086 Assembly - DIV going ape, IP jumping to a weird location endlessly

谁说我不能喝 提交于 2019-12-12 20:00:57
问题 i've been stuck with this problem for like a day, not finding any relevant information.. there's this one part in my code that takes a number (ex. 259) and separates it's digits into array slots. SEPERATE_DIGITS: mov ax,RESULT ; result is the number im working on. RESULT dw 259h mov si,0 SEPERATE_DIGITS_LOOP: div TEN ; TEN dw 10h add dl,30h ; fix-up to print later on mov SEPERATED[si],dl ; store separated digit in my array. inc si cmp ax,0 jne SEPERATE_DIGITS_LOOP i have been debugging it on

Relative jump out of range by 0020h bytes

五迷三道 提交于 2019-12-12 16:24:03
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I had been trying to write a basic com file for a 'shell'. I was able to assemble the same code in NASM with little modifications. However this code won't assemble in TASM ! I get errors of the kind : Relative jump out of range I looked up a little on Google to find out about jumps. However I could not find much, except the idea to break this jump into

I'm trying to use the stored value in AX after the AAM instruction to divide it by 2, Why it doesn't work with 2 digits numbers output?

痴心易碎 提交于 2019-12-12 13:26:32
问题 English is not my native language; please excuse typing errors, the code I will show here is a homework. I really need to understand what's going on. I'm using Intel 8086 syntax, in DosBox 0.74 and TASM assembler. The problem with the code is in the Area of the Triangle when I have to divide by 2. Note: the program always read only 1 digit from the keyboard. Look at the code (a user here suggested to show all my code instead of show it by part, I think is a bit long, but I think he is right,

Does gcc really know how to output NASM Assembly

痞子三分冷 提交于 2019-12-12 07:20:09
问题 So I have a simple C program that loops through the args passed to main then returns: #include <stdio.h> int main(int argc, char *argv[]) { int i; for(i = 0; i < argc; ++i) { fprintf(stdout, "%s\n", argv[i]); } return 0; } I wanted to see how gcc wrote out the assembly in NASM format. I was looking over the output in the .asm file and noticed that the syntax was TASM. Below is the make file and the output from gcc. Am I doing something wrong or is it that gcc does not output true NASM syntax?

Display results of an asm file

守給你的承諾、 提交于 2019-12-11 11:55:03
问题 I'm trying to assemble the following program with Tasm on Windows 7 64bit: .model small .stack 100h .data a db 09H b db 02H .code start: mov ax, @data mov ds, ax mov al, a mov bl, b add al, bl mov ah, 4CH int 21H end start filename is prog4.asm I did follow these steps: tasm prog4.asm tlink prog4.obj prog4 I am able to run this on the EMU8086 simulator, however i'm not able to see the execution of the commands on DOSBOX. How can I display the register values after the addition command? 回答1:

mov al, byte[si + bx] becomes mov al, [bx+si+1]

时光总嘲笑我的痴心妄想 提交于 2019-12-11 11:13:48
问题 While trying to provide a full working (debugged) example for this question, I cannot understand the assembled code. I am a bit rusty with the good old DOS + TASM combination. This is my asm code ( print.asm ): .MODEL SMALL .STACK 64 .DATA string DB 'Something' len equ $-string .CODE Entry: mov ax, @data ;make DS point to our DATA segment mov ds, ax xor bx, bx mov si, offset string Char: mov al, byte[si + bx] mov ah, 2 mov dl, al int 21h inc bx cmp bx, len jnz Char Fin: mov ax, 4c00h int 21h

How to change bits in a char in TASM?

谁说我不能喝 提交于 2019-12-11 08:35:36
问题 I have to write a program which is reading chars from a file, changing bits in every char and writing changes to a new file in TASM. I've written a program which is reading chars from a file and writing them to a new file, but I don't know how to change bits in a char. For example, here would be my file with chars: a // 01100001 b // 01100010 c // 01100011 d // 01100100 So, if we are changing first and second bit to 1, the output should be: c // 01100011 c // 01100011 c // 01100011 g //

How to make timer works? Call int 4ah 5 seconds after start

自闭症网瘾萝莉.ら 提交于 2019-12-11 04:49:57
问题 I'm creating a program, that should print "Hello from handler" five seconds after start. At first I created interrupt 4ah by proc called create_interrupt . This interrupt causes int_handler , that prints string "Hello from handler". Then proc "alarm" get curent time, add 5 second to it and set alarm by func 06h of int 1ah. This alarm should call int 4ah after 5 seconds from start, but it doesn't works and I don't know why. If I call 4ah "by hand", just by adding "int 4ah" it works, it means

TASM Print characters of string

耗尽温柔 提交于 2019-12-11 01:12:51
问题 I'm trying to print a string character by character, iterating through it. This is what I've got: .MODEL SMALL .STACK 64 .DATA string DB 'Something',0 len equ $-string .CODE xor bx, bx mov si, offset string Char: mov al, byte[si + bx] inc bx cmp bx, len je Fin mov ah, 2 mov dl, al int 21h jmp Char Fin: mov ax, 4c00h int 21h END I don't know if I'm getting the right mem reference of string, because it only shows me weird symbols. I tried adding 30 to dl, thinking it was because of the ascii