Golden Squirrel's Profile
Reputation: 0
Apprentice
- Group:
- New Members
- Active Posts:
- 5 (0.01 per day)
- Joined:
- 03-April 12
- Profile Views:
- 156
- Last Active:
May 17 2012 11:24 PM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Does INT 13H work for modern hard disks?
Posted 6 Apr 2012
Fixed it. That code is fine, its just that since I don't have a debugger I couldn't see if it read it or not. The part of that code that is supposed to display the read bytes is not working though, but I can live without it.
My problem is solved then. -
In Topic: Caesar Cipher emu8086 program
Posted 4 Apr 2012
Don't really know what is wrong, but I do know (you might too if you have the emu8086 debugger) that the last letter is 42H (B in ASCII) and it is adding 1DH to it because the previous conditional statements does not fulfill. As you might know in hex 42 + 1D = 5F and 5F is an ASCII underscore (_).
What I did was to change letter B for a "y" manually. I don't know if all "B"s will always be "y", but if not, I wouldn't know what to do since I don't really understand Caesar Cipher.
Add this in between:
cmp al, ' '
je display2
;Add here
cmp al, 7Ah
jge wrap
cmp al, 'B' jne noBletter mov al, 79h jmp display2 noBletter:
Final code would be:
org 100h mov cl, 28 mov ah, 0eh lea si, d1 loop1: mov al, [si] inc si je display1 cmp al, ' ' je display1 display1: int 10h loop loop1 mov dh, 2 mov dl, 0 mov bh, 0 mov ah, 2 int 10h mov cl, 28 mov ah, 0eh lea si, d1 loop2: mov al, [si] inc si cmp al, 'C' je display2 cmp al, ' ' je display2 cmp al, 'B' jne noBletter mov al, 79h jmp display2 noBletter: cmp al, 7Ah jge wrap add al, 1dh jmp display2 wrap: add al, 37h display2: mov ah, 0eh int 10h loop loop2 ret d1 db 'PHHW PH DIWHU WKH WRJD SDUWB'
-
In Topic: Does INT 13H work for modern hard disks?
Posted 3 Apr 2012
no2pencil, on 03 April 2012 - 05:46 PM, said:How are you installing your binary executable to the hard drive? Between booting from Floopy to booting from a Fixed drive, it isn't a matter of code or interrupts (correct me if I'm wrong), it's a matter of addressing. The boot sector on a hard drive isn't the same as a boot sector on a floopy drive.
Ah, now that you mention it, I've always been writing it to a flash drive with an hex editor and booting from the flash drive. I wanted to test it before writing it to the hard disk, but yeah, maybe writing it to the hard disk MBR will make it work. I'll try that. I have already made an application in C++ to backup my current MBR so I don't worry about screwing anything.
GunnerInc, on 03 April 2012 - 05:47 PM, said:Ok, Well do you know why they use floppies to teach you? Well, besides not screwing up your hard drive with you important info, BIOS have limitations, you as the programmer need to work around those limitations and do some calculations and conversions.
Read this
Search for INT 13 Barrier
Does it work? You have to make it work
Have you checked out OSDEV? They cover everything for creating an OS which includes bootstraping
Is cross posted to here
Never read any of that, but now I have read a little of it. Though, I only get a minimal amount of it, there are lots of concepts I'm not familiarized with. I might find something if I keep reading.
This thread wasn't to ask about the code I have, but I'll leave the last one I tried without success for if anyone can spot what I'm doing wrong.
#make_boot# org 7c00h ; set location counter. jmp 0x0000:start ; start: buff DW 512 MOV ES,AX MOV BX,offset buff ;Parameters that will be passed to interrupt 13 to read the hard disk MOV AH,1 ;Read Sectors MOV AL,1 ;Sectors To Read Count MOV CH,0 ;Track 0 MOV CL,0 ;Sector 0 MOV DH,0 ;Head 0 MOV DL,80h ;1st hard disk int 13h ;call interrupt ;Procedure to display the read bytes LEA SI, buff ; Load bytes into SI to display them MOV AH, 0Eh ;teletype function identifier Print: MOV AL, [SI] CMP AL, 0 ;Check if we have reached the end of our message JZ Done ;If the CMP operation before yielded a flag of 0, jump to 'Done', else continue below. INT 10h ;print character stored in AL INC SI ;To read what is contained in the next position of SI JMP Print Done: MOV AH, 0 ;'Wait for any key press' identifier of INT 16H INT 16H MOV AX, 0040h ;Store address to which we will pass a value later to do a cold boot MOV DS, AX ;Move to Data Segment the address value MOV w.[0072h], 0000h ;Store in the segment 0072h of 0040h address the value of 0000h JMP 0FFFFh:0000h ;Move to that address which contains the data that will reboot the system
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
Golden Squirrel hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
Golden Squirrel has no profile comments yet. Why not say hello?