tasm

Jumping back 1000 lines

痞子三分冷 提交于 2019-12-27 04:48:43
问题 I was trying to make a code, that when you're at the very end, it will ask you if you want to try again. If you press 'y', then it will jump back a 1000 lines, right at the beginning of the program. Well obviously, it didn't work out, as I got the error "jump relative out of range". So I made jumps every 50 lines, having a total of 20 jumps, like start: . s20: jmp start . . . s2: jmp s3 . s1: jmp s2 . jmp s1 Now after doing that, I ran the program, and when I pressed 'y', TASM kind of froze.

Jumping back 1000 lines

爱⌒轻易说出口 提交于 2019-12-27 04:48:05
问题 I was trying to make a code, that when you're at the very end, it will ask you if you want to try again. If you press 'y', then it will jump back a 1000 lines, right at the beginning of the program. Well obviously, it didn't work out, as I got the error "jump relative out of range". So I made jumps every 50 lines, having a total of 20 jumps, like start: . s20: jmp start . . . s2: jmp s3 . s1: jmp s2 . jmp s1 Now after doing that, I ran the program, and when I pressed 'y', TASM kind of froze.

Local labels in TASM: Symbol already defined

笑着哭i 提交于 2019-12-25 08:29:06
问题 I want to use local labels in my procedures to prevent the use of prefixes for common labels in my program. I tried using local labels (@@). According to my book, "The life of a local label extends only forward and back to the next nonlocal label". However, when I try to compile the file, the following error message is returned: Turbo Assembler Version 3.1 Copyright (c) 1988, 1992 Borland International Assembling file: test.ASM **Error** test.ASM(20) Symbol already defined elsewhere: @@EXIT *

Why can't i get different mouse clicks coordinates twice? assembly

℡╲_俬逩灬. 提交于 2019-12-25 01:24:38
问题 I have a small procedure that is supposed to check if there was a click and get the click's coordinates. In the first time, it works but when I call it at the second time it doesn't even let me click again... why? what is wrong? I tried everything, put the mouse setting outside the procedure-didn't do any differences. Also, I tried to create some kind of small thing where you click once, put the cx in si and call sam click check again and comparing si and the new cx and it is different (si is

Tasm local variables

风格不统一 提交于 2019-12-24 11:23:29
问题 Using Tasm 1.4 and trying to create and manipulate local variables in procedure: findMins PROC local z:word:1 ;outer loop counter local j:word:1 ;inner loop counter mov cx, rows ;outer loop total iterations mov z, 0 RowsLoop: push cx ; save outer iterations left mov cx,cols ; inner iterations mov j, 2 ColsLoop: //some code loop ColsLoop //some code loop RowsLoop ret ENDP mov j, 2 this instruction changes both j and z local variables. How should I create variables that seen only inside

TASM: Embedded Loops

我与影子孤独终老i 提交于 2019-12-24 09:29:28
问题 does anybody knows what's the syntax for double looping in TASM? I remember you use cx with push and pop function but I don't remember how. Thank you very much. 回答1: Here's how mov cx, 02 ; loop twice cc: ; outer loop push cx ; store outer cx mov cx,03 ; loop thrice bb: ; inner loop ;do stuff loop bb pop cx ;get outer cx loop cc that's basically it 来源: https://stackoverflow.com/questions/5849606/tasm-embedded-loops

File size in assembly

血红的双手。 提交于 2019-12-24 06:36:16
问题 I have a following code written in TASM assembly for reading from a file and printing out the file content using a buffer. Buffer declaration: buffer db 100 dup (?), '$' ;regarding to comment, buffer is db 101 dup (?), '$' EDIT The structure of my program is: Task 1 is asking me for a file name (string) which I want to read. After I input file name, the procedure task1 opens the file. mov ah, 3dh xor al, al lea dx, fname int 21h ;open file jc openError mov bx, ax Not sure, if opening the file

TASM mouse input

一世执手 提交于 2019-12-24 00:59:29
问题 I am working on an assembly project with TASM, DosBox and Notepad++. I draw a dot on the screen and I need to know if the user clicked on it (right mouse). I tried to check if the user clicked right mouse and then if the click coordinates are the same as the dot coordinates. For some reason it's not working. Here's my proc: proc SetCursor ;initialize the mouse mov ax, 0h int 33h ;show mouse mov ax, 1h int 33h ; get mouse place and status mov ax, 3h int 33h ret endp SetCursor Here I call it:

How do I print SVGA Info on the screen in tasm?

主宰稳场 提交于 2019-12-22 09:50:10
问题 I am complete beginner to assembly, and graphics, any help would be appreciated. I got the svga info, but when i print it, it won't print anything. If anyone can explain why that would be great. Here is the code. If there is anymore explanations needed for what I have done let me know .MODEL SMALL .STACK 64 .DATA getinfo: VbeSignature db 'VESA' ; VESA VbeVersion dw 0000h ; Version OemStringPtr dd ? ; Producer Capabilities db 4 dup (?); Reserved VideoModePtr dd ? ; Modes TotalMemory dw ? ;

TASM:How to printout a register pair dx:ax on screen after multiply?

大憨熊 提交于 2019-12-20 07:45:19
问题 include io.h cr equ 0dh lf equ 0ah stacksg segment stack dw 100 dup(?) stacksg ends datasg segment prp1 db '1st Number:',cr,lf,0 prp2 db '2nd Number:',cr,lf,0 prp3 db 'The result:',cr,lf,0 numA dw ? numB dw ? sum dw 20 dup(?),0 entersim db cr,lf datasg ends codesg segment start: assume cs:codesg,ds:datasg mov ax,datasg mov ds,ax output prp1 inputs numA,10 atoi numA mov numA,ax output prp2 inputs numB,10 atoi numB mov bx,ax mov ax,numA mul bx itoa sum,ax output entersim output prp3 output sum