tasm

Assembly - bubble sort for sorting string

与世无争的帅哥 提交于 2020-01-09 05:36:48
问题 I am writing a program in assembly using tasm. My task is to write a program that will use bubble sort to sort entered string alphabetically. Ex. if you enter "hello" it should write "ehllo". I have writened the begging to enter string and to sort it (I think it works okey until the end where it should print out the result, but at the end it just writes my .data once and the finisheds its work) P.S sorry for bad english .model small .stack 100h .data request db 'This program is using

TASM; LOCAL and LOCALS directives

别等时光非礼了梦想. 提交于 2020-01-06 21:02:50
问题 I am writing a program on assembler using TASM 4.1 and I have stumbled upon a problem I have been unable to fix for 2 days. The problem is that TASM just won't recognize labels in macro as local labels and would give me an error when assembling (Symbol already defined elsewhere). So far I have tried the following things: Putting LOCALS at the very beginning of .asm file and using @@ for local labels (as was suggested in one of the answers to a similar problem). Produced zero effect whatsoever

Assembly on DOS (TASM), creating TSR with a new handler on int 21h

孤街醉人 提交于 2020-01-05 06:47:25
问题 I have a trouble with making TSR com file for DOS. It should set a new handler on a 21'th interrupt, terminate and stay resident. New handler should transfer control to an old interrupt 21h handler. I save its interrupt vector, but have no idea how to call it correctly. Here is a program: .model tiny .data old_int21h dw ?, ? .code org 100h start: ;saving old interrupt vector mov ax, 3521h int 21h mov [old_int21h], bx mov [old_int21h + 2], es ;setting new interrupt vector cli push ds push cs

Nested loop in x86 Assembly? [closed]

混江龙づ霸主 提交于 2020-01-04 06:35:38
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . Maybe this is stupid, but I'm pretty new to assembler, so please bear with me. Is there any way to implement nested loops in assembler? An example would

Nested loop in x86 Assembly? [closed]

眉间皱痕 提交于 2020-01-04 06:33:27
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . Maybe this is stupid, but I'm pretty new to assembler, so please bear with me. Is there any way to implement nested loops in assembler? An example would

how to use negative numbers as one in assembly?

纵然是瞬间 提交于 2020-01-04 04:46:06
问题 I have a arithmetic program in assembly, but when i add, subtract, multiply negative numbers, it will not result in desired output. For Example input: -1+2=66675 (should be 1) -1-1=656745 (should be -2) -1*-1=66757 (should be 1) Questions: how would i treat (-) and (1) as one? how to do arithmetic operation in signed numbers? any advice please ... 回答1: I recommend reading up on 2's compliment and the difference between signed and unsigned ints. The value you are showing looks suspiciously

Assembly(tasm) program crashes in run but works fine in debugger(turbo debugger)

可紊 提交于 2019-12-31 05:42:55
问题 My program(assembly tasm 16bit) supposed to print a bar graph represtion for an array.Right now its only supports specificarray but I will add support for general cases in the future.The code works fine in debugger and prints the bars as expcted.But in run the code gets stuck and dosent print anything. All the functions apart from PrintArr were working separately as expcted. I cant find my problam in debugging beacouse the problame dosent seem to exist in the debugger. ; IDEAL MODEL small

What does SEG directive do in 8086?

落爺英雄遲暮 提交于 2019-12-31 03:47:53
问题 SEG A : Assigns the content held in segment register corresponding to the segment in which A resides to the operand. I guess that means that if A lies in Data Segment, SEG A is the same as DS . Since DS holds the base address of the Data Segment, does MOV AX, LEA A MOV DX, SEG A MOV AX, [AX + DX] copy the physical address of A to AX ? 回答1: I guess that means that if A lies in Data Segment, SEG A is the same as DS. Correct, if DS points to Data Segment. does MOV AX, LEA A MOV DX, SEG A MOV AX,

Unable to keep a square a full square while moving it

寵の児 提交于 2019-12-31 02:55:19
问题 I have been trying to draw a box in assembly and move it horizontally across the screen. The code of printing the square itself works for me but when I try to make it move it is not working very well. I can see it moving but not as a full square, if you get my point. My code: in Assembly Tasm STA SEGMENT STACK DB 0FFFeH DUP(?) STA ENDS DATA SEGMENT ;----------- ;VARIABLES HERE xpos dw 50h ypos dw 50h color db 9h constat equ 0ffffh siNum dw ? diNum dw ? numOFtime dw 0h ;------------- DATA ENDS

How can I convert HEX to DECIMAL?

若如初见. 提交于 2019-12-30 05:34:08
问题 I plan to convert the X variable to decimal. I'm having a hard time using turbo assembler, can you give a hand? code segment ;inicio de un segmento unico assume cs:code,ds:code,ss:code org 100h ;localidad de inicio del contador main proc ;procedimiento principal mov ax,cs mov ds,ax ; INICIO mov ax, x mov ah,4ch ;comienzo del fin de programa int 21h ;fin del programa main endp x dw 0A92FH code ends ; fin del segmento de codigo end main ;fin del ensamble Thanks a lot 回答1: When converting