Forum: Assembly 3 Hours Ago |
| Replies: 4 Views: 94 Well, device independence is when an abstract
interface is provided for software to access
the hardware without intimate knowledge
of the hardware configuration of the host
system upon which it... |
Forum: Assembly 8 Hours Ago |
| Replies: 2 Views: 71 So your getting a hexadecimal value from the command
line in the form of asci characters???
Couldn't tell exactly what your code was doing.
Heres an example, the asci string '72' is specified as... |
Forum: Assembly 8 Hours Ago |
| Replies: 4 Views: 94 Those compilers pump out assembler for you,
I say its technically for convience because the program
could be coded on the bare metal,
Remember for code to do anything it eventually has to
have... |
Forum: Assembly 1 Day Ago |
| Replies: 1 Views: 233 I don't know what is wrong with your code,
I didn't take a long look at it, I am used to staring at 16-bit code.
I noticed you are using the linear address of the color video
ram 000B8000, I do... |
Forum: Assembly 1 Day Ago |
| Replies: 4 Views: 94 Give me convience or give me death!
The would-be programmer is
introduced in some way to what could
be compared to a CS101 course.
He is taught about algorithms,
variables, procedures,... |
Forum: Assembly 2 Days Ago |
| Replies: 1 Views: 121 There is no standard library for assembly language,
of course implementation of the aforementioned routines
are done on the bare metal.
You may want to fetch yourself a good old book on
assembly... |
Forum: Assembly 2 Days Ago |
| Replies: 4 Views: 292 Here's my code if it will help.
Hope I don't go to heck, any more delusional thoughts???
bits 16
org 100h
bum:
mov dx, isr1_grave
mov ax, 0x2501 |
Forum: Assembly 2 Days Ago |
| Replies: 4 Views: 292 You have two problems in your interrupt 1 handler:
registers are not pushed and restored,
your divisor is zero.
Also when divisor is 8-bits, AX / divisor
hence:
mov ax, 10h
div byte [nl] |
Forum: Assembly 13 Days Ago |
| Replies: 5 Views: 348 That's actually kind of funny, I usually have a hard time
not breaking my programs down into procedures.
I think it is essential to know what pieces of code
to encapsulate into procedures and how... |
Forum: Assembly 14 Days Ago |
| Replies: 5 Views: 348 I'm sorry I didn't know that you were required to let the
user enter a fourth character.
So they can enter a variable number of chars up to the
maximum amount,
and always use a termination... |
Forum: Assembly 14 Days Ago |
| Replies: 1 Views: 327 But I know, you are a coder.
Your code does work ;)
MOV A,#8d ; value for the factorial (1-8max)
MOV B,A ; B=A
MOV C,#1d ; C=1
here: ; LOOP
SUB B,C ; B-1
MUL AB ; AxB
CMP B,C ;if B=1 |
Forum: Assembly 14 Days Ago |
| Replies: 5 Views: 348 I wrote up an NASM source with similar functions to your
own code. A function for reversing the array, for
adding the two arrays as unpacked BCS, and for entering
values are here. Call to array... |
Forum: Assembly 16 Days Ago |
| Replies: 4 Views: 566 CBW - Convert Byte to Word
Sign extends the byte in AL into the word in AX.
Sign extension is merely copying the sign bit into the rest
of a datatype when a signed value is moved into a larger... |
Forum: Assembly 21 Days Ago |
| Replies: 3 Views: 397 As to storing multiple things in a variable,
a word is really two contiguous bytes:
albl dw 0
;same as
albl2 db 0, 0
and can hold two asci values.
If we reserve room for an array of bytes: |
Forum: Assembly 23 Days Ago |
| Replies: 2 Views: 373 On the MS-DOS system functions for input I usually
use, atimes a Carriage-Return character is at the
end of the buffer lest the maximum count of
characters is met. 21/3F
0xd ends the input, that... |
Forum: Assembly 23 Days Ago |
| Replies: 4 Views: 386 [[[AxxAxLLlaLLLaXBxG]]]]
mov cx, 0x10
mov ax, 0x123
db 0x66
shl ax, cl ; shift 0x123 into high-word of EAX
db 0x66
shr ax, cl ; shift back into low-word of EAX, that is, AX
You would need... |
Forum: Assembly 27 Days Ago |
| Replies: 1 Views: 385 I am trying to create an active TSR which prints an 'A'
when the ESC key is pressed, it doesn't work.
Can anyone tell me what's wrong?
bits 16
org 100h
jmp init.tsr |
Forum: Assembly 28 Days Ago |
| Replies: 6 Views: 7,292 Func AH=2 INT 13h Disk Services:
CH=Low eight bits of cylinder number
CL=Sector number should start at 1
bits 6-7 represent two high bits of cylinder number (hard disk only).
So the MBR would be... |
Forum: Assembly 30 Days Ago |
| Replies: 2 Views: 268 80X86 Speeding up word memory access.
When the address of the first byte of a word lies
at an odd address the processor must make two memory
fetches for each byte of the word.
But if the address... |
Forum: Assembly 30 Days Ago |
| Replies: 3 Views: 275 IF ESI=OFFSET ARR and Addr ARR=00000100h
[ESI+ESI] -> DS:00000200h 256 bytes past first byte of array |
Forum: Assembly 30 Days Ago |
| Replies: 3 Views: 275 .data
arrayD WORD 10, -60, 30
.code
mov esi, OFFSET arrayD
mov ax, [esi+0] ; AX=10 initialize AX to value of
; first word
add ax,... |
Forum: Assembly 30 Days Ago |
| Replies: 1 Views: 293 mov ds, seg buff ; works in MASM
mov si, offset buff
All you need is the segment address on which the buff string
lies, this is because your generating an .EXE.
Here's one way to wait for a... |
Forum: Assembly 31 Days Ago |
| Replies: 1 Views: 305 mov eax, dword [esi] ;moves first position of array into eax
And also moves a double word EAX=44434241h, I think so,
not sure.
To read each byte at a time do:
xor eax, eax
mov al, byte [esi]... |
Forum: Assembly 31 Days Ago |
| Replies: 3 Views: 376 HLT will save CS:IP or CS:EIP of instruction after hlt
and stop instruction execution until a external interrupt
or NMI is issued.
It puts the processor in a halt state.
HLT is a priviledged... |
Forum: Assembly 31 Days Ago |
| Replies: 1 Views: 281 Give me convience or give me death...
This is 16-bit code, but it should give you the
general idea, the LOOPZ will decrement CX even if the ZeroFlag
is clear (no Zero Result), both LOOPZ and... |
Forum: Assembly Oct 18th, 2009 |
| Replies: 2 Views: 420 To change,
newmem2:
mov eax,0x3e8
so that EAX will be loaded with the value
0x3e8+0x100 replace with:
mov eax,0x3e8+0x100
This varient of mov instruction has immediate as the source
operand,... |
Forum: Assembly Oct 18th, 2009 |
| Replies: 2 Views: 267 You loaded your counter variable starting at counter+2 which
causes the ASCII character 5 to be printed on the screen,
that is the initializer you used for the first byte of the
array at counter:... |
Forum: Assembly Oct 18th, 2009 |
| Replies: 3 Views: 339 The reason jibberish is output to the consol is because
DX is to contain the offset of a dollar-sign '$' terminated string.
mov dx, offset msg
mov ah, 0x9
int 0x21
int 0x20
msg db 'hello... |
Forum: Assembly Oct 15th, 2009 |
| Replies: 2 Views: 265 An Overflow in assembly occurs when the result of
an arithmetic instruction is larger than the destination
operand. For instance, a Divide Overflow occurs when
the quotient is larger than the... |
Forum: Assembly Oct 15th, 2009 |
| Replies: 1 Views: 317 You are indexing into the IVT when interrupts are enabled,
and the timer tick INT 8 calls INT 1c, and INT 8 is called
by external hardware.
This means the interrupt is being called while your... |
Forum: Assembly Oct 15th, 2009 |
| Replies: 19 Views: 738 To print out your commandline arguments with
function 9, simply add a '$' to the end of the actual command tail.
example:
xor bx, bx
mov bl, [0x80]
mov byte [bx+0x81],'$'
mov bx, 0x81
But... |
Forum: Assembly Oct 14th, 2009 |
| Replies: 19 Views: 738 16-bit OS dos I need help vortex reign....
Hello, to answer your question NASM16 is a 16-bit (80x86) assembler
for MS-DOS.
To access commandline parameters, they are passed by the
loader (your... |
Forum: Assembly Oct 14th, 2009 |
| Replies: 6 Views: 1,045 Another way to print out the value of a byte in hEx is:
printb: ; Byte with value to print is in AL
push ax
shr al, 4
call printasc
pop ax
push ax
and al, 0xf |
Forum: Assembly Oct 13th, 2009 |
| Replies: 1 Views: 260 start:
my_arr db ? ; the instruction pointer is running into junk!!!
mov dl, [my_arr] ; you didn't read any char from the keyboard
mov [my_arr], al
add dl, '0'
mov ah, 2h
int 21h
change... |
Forum: Assembly Oct 13th, 2009 |
| Replies: 1 Views: 417 Color text-mode memory lies at segment 0xb800 and is 4000 bytes
in length 80*25*2 cuz each visible character on the screen
is accompanied by a text attribute byte.
00000000 Text Attribute Byte... |
Forum: Assembly Oct 11th, 2009 |
| Replies: 2 Views: 353 PAINT_A_PIXEL example code...
bits 16
org 100h
start:
mov ax, 0xa000
mov es, ax
call govideo |
Forum: Assembly Oct 11th, 2009 |
| Replies: 3 Views: 395 Suprisingly I did not know that JA was for unsigned
and JG was for signed, etc...
Thanks for the post wildgoose! |
Forum: Assembly Oct 11th, 2009 |
| Replies: 8 Views: 381 Oh I see what you are saying wildgoose!
With packed BCD's you could use the DAS instruction to count-down
in your program using a decimal value...
mov bh, '8'
mov bl, '0'
sub bh, 0x30
sub... |
Forum: Assembly Oct 11th, 2009 |
| Replies: 8 Views: 381 Sorry I made a mistake in my last post,
it should have been 9*10^1
mov cx, 1
mov ax, 10
call pow
mov bx, 9 ; result is in AX
mul bx |
Forum: Assembly Oct 10th, 2009 |
| Replies: 2 Views: 353 Painting pixels, not so much tedious work.
Try MCGA mode 13h you can set this using the video bios,
if you are in 32-bit code try passing down the call to the
BIOS through the DPMI server.... |