152 Posted Topics

Member Avatar for D-P

Jackal hex digit hunt, hunts digits and runs! Hello coder, it is simple. Two hexdigits make up one byte, one making up the high nibble (4-bits) and the other the low nibble (4-bits). To get the high nibble simply bitshift the byte to the right by four bits. And to …

Member Avatar for NotNull
0
1K
Member Avatar for heat89

[code] 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 [/code] change to: [code] .data my_arr db ? .code start: mov dx, seg my_arr …

Member Avatar for NotNull
0
114
Member Avatar for MichaelSammels

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 XXBGxxFG The low-nibble defines the foreground and the high-nibble the background, and there is a way to disable …

Member Avatar for NotNull
0
4K
Member Avatar for tomtetlaw

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. AH=0000 AL=0013 INT 10h INT 10/AH=00 Set Video Mode 10/AH=0C Write Pixel 10/AH=0D …

Member Avatar for NotNull
0
2K
Member Avatar for nikolai090

So you used the ASCII value of the digit character in a count down variable, limiting the number of seconds from 0-9. Here's how you could use a two digit number: For 19 for example, this would come in from the keyboard as 31h 39h 31h - 30h = 1 …

Member Avatar for NotNull
0
2K
Member Avatar for jingo1126

AH=3Ch takes an ASCIZ null terminated file name pointed to by DS : DX same for AH=5Bh but 5Bh will not create the file if it already exists. Besides this all the other parameters are correct, you just need to pass it the address of a null-terminated instead of a …

Member Avatar for jingo1126
-1
150
Member Avatar for c+++

If your looking for an actual hard-wired address you could use to retrieve the current time, or at least clock ticks, I think this would be contained in the BIOS data area, which starts at physical address 00400. The data area of the BIOS would only be accurate in a …

Member Avatar for NotNull
0
85
Member Avatar for jingo1126

A file-manager is a nifty idea for a project, the complexity of the project will depend on your choice of a user-interface. Copying,Moving/Renaming,Deleting,Changing/Retrieving the attributes of,retrieving and setting date/time of files can all be accomplished with INT 21h function calls. I believe the same date/time format for FCBS is used …

Member Avatar for jingo1126
-1
160
Member Avatar for fma_circuit

I don't feel like cranking out code, get yourself an architecture manual. There are the fruits of learning this, take a look: number systems addressing instruction format system architecture Sorry if we sound a little mean but the beginning starts with you doing a little personal study. Once you can …

Member Avatar for NotNull
-1
122
Member Avatar for jingo1126

Using a fixed and not so variable method to encrypt. Once broken it is done. Simple XOR encryption: XOR encryption is the simplest encryption algorithm and uses a key (variable in length) for encryption. key for exampe is 10001011 0x8B 00000101 ^ 10001011 = 10001110 0x8E 10001110 ^ 10001011 = …

Member Avatar for NotNull
-1
154
Member Avatar for andreib

2005 - 2000 = 5 / 1 = 5 got it??? The actual value of the asci characte '5' is 0x35, well there you go! Understanding the DIV instruction: DIV reg16 = DX:AX / reg16 = quotient AX remainder DX DIV reg8 = AX / reg8 = quotient AL remainder …

Member Avatar for NotNull
-1
162
Member Avatar for jingo1126

It is not a segment issue, he is generating an .exe file, which uses multiple segments. I got the code to work: [code] .model small .stack 100h .data file db "TEST.TXT",0 ; File name new db "Rename.txt",0 ; New name .code start: ; use function 0E to change drive mov …

Member Avatar for jingo1126
-1
1K
Member Avatar for jingo1126

Function 3Ch takes a null-terminated ASCIZ string pointed to by DS : DX and your passing it a '$' terminated string. I think that's your problem.

Member Avatar for NotNull
-1
308
Member Avatar for Nathan Campos

I've just started using MASM, this was due to the ability to have multiple ORG directives, and was tempting for when I make a piece of code that splits apart it's executable to another segment in memory. I also use and have used GAS/NGASM/NASM/A86, and still plan on testing more.

Member Avatar for NotNull
-1
93
Member Avatar for blerina12

Access violation is caused when a program attempts to access memory reserved for the operating system. I thought this could only happen in a windows program? I assume your using MASM: [code] mov ax, seg message ; initialize the DS register so mov ds, ax ; you can access variable …

Member Avatar for blerina12
-1
510
Member Avatar for punchinello

[code] mov dl, 0x31 mov ah, 0x2 int 0x21 [/code] ^----Should display a '1' Maybe it is about where you defined your stack, and your memory variable got overwritten when external interrupts needed the stack... On top of this, I do not see a value defining the size of the …

Member Avatar for NotNull
-1
93
Member Avatar for punchinello

Converting binary ordinal to ASCI decimal representation. ---------------------------------------------- Memory locations contain values, in order to display them we must convert the value to the digits of a number system and display a character for each one. For example to convert the value 123d into '123' 0x31,0x32,0x33: The steps are taken: …

Member Avatar for punchinello
-1
161
Member Avatar for jingo1126

Here's how you can check if MCGA mode is supported, and plot a pixel to the screen. If the prog screws up MCGA mode might be temporarily disabled (in the console) until the console window is closed and opened again. Try it out. [code] start: mov ax,0x1a00 ; Check if …

Member Avatar for jingo1126
-1
4K
Member Avatar for Alex_

INT 21 - DOS 2+ - "LSEEK" - SET CURRENT FILE POSITION AH=42h AL=origin of move 00h - start of file 01h - current file position 02h - end of file BX=file handle CX : DX = (signed) offset from origin of new file position return: CF clear if successful …

Member Avatar for NotNull
-1
1K
Member Avatar for NotNull

Load a user generated character set, should work on computers equipped with VGA cards. Assembles with 16-bit NASM as an absolute binary image (.COM). [code] bits 16 org 100h jmp word drip0_start char_set: times 416 db 0 msg db '0o l0^d user char generated',0xd,0xa db 'bitmaps can also be used....',0xd,0xa,0x24 …

Member Avatar for NotNull
0
134
Member Avatar for rvaiksaar

As mentioned by Alex_ applications in a multi-tasking enviroment do not run simultaneously but yield the processor one at a time. Each process yields the processor for some predetermined amount of time and then the registers upon which the task depends is backed up in the RAM, and the next …

Member Avatar for rvaiksaar
0
114
Member Avatar for markfisher

I would assume the .386 directive means to generate 32-bit code. And your calling 16-bit Dos interrupts??? I don't know what else is wrong, I do not use MASM.

Member Avatar for wildgoose
0
157
Member Avatar for codeguru_2009

His origin is at 7C00h because the BIOS bootstrap will load the first sector of a drive containing a valid boot sector at physical address 07C00h and will jump to it loading CS with 0 and IP with 7C00h.

Member Avatar for NotNull
0
175
Member Avatar for NotNull

I have the address of the first byte of an array, the address of the array +4 would get me the address of the fifth byte, the address of the array +0 would get me the address of the first byte. For example: [code] arr db 1,2,3,4,5 mov bx,offset arr …

Member Avatar for wildgoose
0
81
Member Avatar for oufa
Member Avatar for NotNull

Some 16-bit stuff... A segment address is bit shifted to the left by four bits to form a 20-bit physical address and a 16-bit offset is added to the result to index into a segment. So 1234:0100 would create the physical address 12440 Is this correct???????????

Member Avatar for wildgoose
0
88
Member Avatar for Nathan Campos

I use: Insight 1.23 GUI debugger for debugging DOS programs, XVI32 windows hex editor, NASM 16-bit Assembler A86 16-bit shareware assembler for my pocket computer.

Member Avatar for NotNull
0
111
Member Avatar for xellos

Here is a really cool piece of code for printing out the decimal representation of values. The amount of digits can even be adjusted! Value to be printed is placed on the stack. Enjoy! [code] bits 16 org 100h start: push 1234 call putdec_w add sp,2 ret putdec_val dw 0 …

Member Avatar for NotNull
0
2K
Member Avatar for Nathan Campos

When I created a multi-stage bootloader I assembled my first bootloader code so that it would be made into a 1.44MB floppy disk image. Then assembled the second stage as a bare binary image. Then I used a hex editor to place the second part at the next consecutive sector. …

Member Avatar for NotNull
0
134
Member Avatar for Nathan Campos

If you place this at the end of your assembly source: [code] ; fill rest of binary image to 1.44MB, to make disk image. times 1474560 - ($ - $$) db 0 [/code] Your generated binary WILL be a floppy image, and can be booted by Bochs. It must be …

Member Avatar for NotNull
0
851
Member Avatar for xellos

[code] bits 16 org 100h jmp start buf db 32,0 times 32 db 0 start: mov dx,buf mov ah,0ah ;you called function 0ah correctly int 21h ;you terminated the string and used function 09h correctly mov bl,[buf+1] xor bh,bh mov byte [bx+buf+2],24h mov dx,buf+2 mov ah,09 int 21h int 20h …

Member Avatar for NotNull
0
538
Member Avatar for Nathan Campos

All values stored in memory are represented in binary, so I would assume that if you had a decimal value it would be the ASCII representation of a decimal value, as if it were entered in by the keyboard. So the value 63 would be represented thus in ASCII: 36h='6' …

Member Avatar for Nathan Campos
0
231
Member Avatar for Nathan Campos

Dollar-sign '$' refers to the assemblers counter when calculating offsets, the 'times' directive tells nasm to repeat some opcode several times. In this case 'db' which declares a byte in the binary image.

Member Avatar for Nathan Campos
0
108
Member Avatar for Nathan Campos

Hello, you could read your bare binary file into a segment of memory and write it out to the disk drive using interrupt 13h function 03h (write sectors), get ralf browns interrupt list! You would need to write it out to head 0,cylinder 0,sector 1. The last word of the …

Member Avatar for Nathan Campos
0
696
Member Avatar for jakx12

Usually when a C program is compiled into an executable access to the file system and console I/O is performed through the underlying operating system's API using executable instructions intended for execution on a particular architecture (like x86-32). The executable format will be dependent upon the OS involved as well, …

Member Avatar for NotNull
0
167
Member Avatar for deostroll

[code] var db '$' ; actually stores the value 0x24 into the byte 'var' var db $ ; would attempt to store the current offset ; but would thow an error for an offset is 16-bits [/code] You are allowing your program to run into junk you should define your …

Member Avatar for wildgoose
0
2K
Member Avatar for wicked357

I assume you would like to turn the value in memory into the asci representation of the decimal value. For example, the value 20h (32d) in a byte into the asci characters 33h '3' and 32h '2', sent to the console would display '32'. For the value 231, the following …

Member Avatar for NotNull
0
277
Member Avatar for wicked357

With a 32-bit divisor it is divided against the quad-word in EDX:EAX, quotient is returned in EAX, remainder in EDX. You said you do not understand the hi and lo part, they represent the high and low DWORDs of a 64-bit value. Thus EDX:EAX represent one whole value, EDX representing …

Member Avatar for NotNull
0
84
Member Avatar for BlackJackVr

ESP points to the current top of stack, PUSH & POP implicity decrement and increment ESP. Right upon entering your function ESP points to a DWORD containing the return address (address of the instruction past the CALL). RET will pop the DWORD off the stack (according to the value of …

Member Avatar for NotNull
0
151
Member Avatar for Motvel

Here is a link to some assembly help & code on using USB under DOS. You might want to check out your keyboards specks. [url]http://www.frontiernet.net/~fys/usb.htm[/url] I might drop by with more info, no guarantees.

Member Avatar for cuocthiseo01
0
148
Member Avatar for zafirah_bashir

This is because when you output the value 03 to the screen using AH=02h of INT 21h it will write it to text mode memory, when this is done it will display the associated ASCII character, which for 03 is the Heart symbol. It seems you would like to display …

Member Avatar for NotNull
0
127
Member Avatar for Sci@phy

[code] mov ax,0900h mov dx,offset label_name ; seg label_name will actually ; move a word at the offset ; represented by label_name, ; to load the actual offset it ; represents use this. int 021h [/code] The lea (Load Effective Address) instruction, is good to find the resulting effective address …

Member Avatar for NotNull
0
120
Member Avatar for mathematician

Whether educational or for hobby, to undertake defining the os enviroment, is a lengthy task. There is much to learn, and to gain experience controlling, maintianing and setting up the system, such experience is fundamental for making system software, and drivers, for the same architecture. When writing for a kernel, …

Member Avatar for NotNull
0
128
Member Avatar for carson myers

As with programming, to reproduce any software on an architecture certainly is the ability of low level code. "I tell my CPU what to do", and it does it, this is machine language, and represents the actual executable code of a compiled language, deriving properties common and machine dependent according …

Member Avatar for NotNull
0
116
Member Avatar for king_khan

Some Questions Solved: 1256A 1256:000A = (1256h*10h) + Ah = 1256Ah 1240:016A = (1240h*10h) + 16Ah = 1256Ah [code] mov ax,0FFFFh mov bx,0FFFFh add ax,bx [/code] CF=1 PF=0 ZF=0 OF=0 Dont have time for question three, right now...

Member Avatar for NotNull
0
160
Member Avatar for phingphing

Here is a outline of a data structure in the data region of a assembly program, common intel syntax assembler directives are used: [code] ENT_TREE_1: ; Tree structure consists of 8-byte records dw 56,34 ; Data POINTER_NODE_L_1: ; Here a pointer is stored, it will be essential when dw ENT_TREE_1_2 …

Member Avatar for NotNull
0
3K
Member Avatar for cam875

Download the GNU Fileutils [url]ftp://gd.tuwien.ac.at/pc/dos/djgpp/current/v2gnu/fil41b.zip[/url] Assemble your bootloader as a binary image. Use dd to write your bootloader to the boot sector of a floppy. dd if=Boot.bin bs=512 of=a: ["of=a:" Don't know if this is the right syntax under DOS for DD, but the above link comes with documentation, all …

Member Avatar for NotNull
0
129
Member Avatar for fleahman

What exactly are you trying to do? Why are 6 numbers required in your algorithm?

Member Avatar for NotNull
0
123
Member Avatar for urufukiba

You are wondering how you can have variable data in your string. There are two methods, that is, having a pointer (an offset) to a variable stored right after the string, or have room for the variable itself right after the string. In either case your pointer or the variable …

Member Avatar for NotNull
0
92
Member Avatar for mustafaneguib

A better way to slow down the progam than using instructions to give the processor many operations, which in the case of assembly, could lead to errors, is to use an empty loop of many iterations. As a modification to your above code, consider using your normal call to your …

Member Avatar for NotNull
0
125

The End.