[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CompareCppBuilderWithDelphi » CFopen » PDS » QbasicFAQ_PrintControlCodes » Paul Allen » CppCin » BeginnersGuideToCPlusPlus » CppDouble » WhatLinksHere » ComputerScience » talk:OrphanPages
This page is to discuss "special:OrphanPages". You can ask questions or make comments.
What is a talkpage?
010101010101010101010101010101010101010101 0 1 0 Assembly broken down 1 0 1 0 by rustymemory of uk2duohet 1 0 .we share thus we are one. 1 010101010101010101010101010101010101010101 Session 1 - introduction
what is assembly? Assembly languages are processor-specific low-level languages. They are rarely used any more except for handling very low-level machine-specific tasks, since languages like C can generally satisfy most requirements, even low-level ones. The other main use of assembly language is to provide the "glue" to enable different languages to be used in a single program. It is however useful to know something about assembly language to get a feel for what goes on inside a processor, as well as for understanding code generation in compilers and for debugging when there is no source code available. -"BURKS version 6" __________________Assembly___________________ | | | instruction set BIOS interrupts Dos interrupts -mov -ready subroutines -add in bios -jmp -.....
Lets start by the features and draw-backs of the assembly language talking simple we can say.
[1]Features: a- Speed. b- Protection. c- i/o access. d- Size "it matters baby". [2]Draw-Backs: a- No 3d graphics. b- not good with math calculations. c- lack of documentation. Splitting "Assembly" = i) Debugger ii) Assembler
a) debugger --> for editing, No variables , No lables. types of debuggers --> gdb. soft-ice. periscope. .......... b) Assembler --> Nasm "http://www.cryogen.com/Nasm/". Tasm "http://home.comcast.net/~tasm/tasmdnl.htm". Masm "http://webster.cs.ucr.edu/AsmTools/MASM/".
LETS REALLY START
[3]Registers:- [i]General purpose registers: registers that can be divided into two equal parts of 8 bits each , each can be used individualy: AX --> accumulator register -- divided gives AL "low" ,AH "high". think of AX "int a =5;", which means that the register can hold a value. "EAX,AX,AH,AL" BX --> Base address register -- divided gives BL, BH. think of BX "char *add = 0x45", which means that BX is a pointer to memory address. "EBX,BX,BH,BL" CX --> Counter register -- divided gives CL,CH. think of CX "for(i = 0; i <= 10; i++);" which means that CX is used for loops. "ECX,CX,CH,CL" DX --> Data register -- divided gives DL, DH.It is used for I/O port access, arithmetic, some interrupt calls. "EDX,DX,DH,DL" [ii]Index Registers " cannot be divided": SI - Source index register DI - Destination index register these registeres are used to copy a block from a location to another. [iii]Segment registers "pointers that point to of 64k each":- DS - Data segment CS - Code segment --> used for instructions SS - Stack segment --> points to a stack segment ES - Extra segment
lets analyse line 1 : Mov BX,100 --> make BX point to memory address 100 line 2 : Mov AL,[BX] --> copy the content inside memory address 100 to the AL register line 3 : Mov BX,0 --> forget about 100 ;)
Some notes: F -->15 FF -->225 FFFF -->64k FFFFF -->1024 "1mb"
solution is to divide memory into 64k segments(16 segments each 64k), locations in memory are determined by: [i] Segment number , [ii] offset inside the segment.
[4]Addressing modes:-
There are several type of addressing which we will talk about, we have : [a] immediate addressing, direct addressing, [c] indirect addressing{, [i] base addressing, base relative addressing, [ii] indexed addressing, relative indexed addressing, [iii] base indexed addressing, [iv]base indexed relative addressing}, [d] stack addressing. "OUCH"
wrong example: mov DS,3000 you cannot store in a Segment register. another wrong example: mov 30,AL 30 is not a register nor a address location. lets take a wrong example and solve it :) mov [30],5 "wrong wrong wrong" solution: first of all we must determine the format of 5 either a byte or a word in other words:- mov byte ptr [30],5 ----> this means that at 30"address" there is a pointer to a byte. mov word ptr [30],5 ----> this means that at 30"address" there is a pointer to a word. 5 = 05 byte ; 5 = 0005 word "2 bytes" correct example: mov ch,0 this doesnt affect the 0 flag register because this 0 stored in ch is not result of an operation in the ALU. the zero flag is affected by the results of operation executed in the alu only.
[Edit this page] [Page history] [What links here] [Printer Friendly]
CompareCppBuilderWithDelphi » CFopen » PDS » QbasicFAQ_PrintControlCodes » Paul Allen » CppCin » BeginnersGuideToCPlusPlus » CppDouble » WhatLinksHere » ComputerScience » talk:OrphanPages
This page is to discuss "special:OrphanPages". You can ask questions or make comments.
What is a talkpage?
010101010101010101010101010101010101010101 0 1 0 Assembly broken down 1 0 1 0 by rustymemory of uk2duohet 1 0 .we share thus we are one. 1 010101010101010101010101010101010101010101 Session 1 - introduction
what is assembly? Assembly languages are processor-specific low-level languages. They are rarely used any more except for handling very low-level machine-specific tasks, since languages like C can generally satisfy most requirements, even low-level ones. The other main use of assembly language is to provide the "glue" to enable different languages to be used in a single program. It is however useful to know something about assembly language to get a feel for what goes on inside a processor, as well as for understanding code generation in compilers and for debugging when there is no source code available. -"BURKS version 6" __________________Assembly___________________ | | | instruction set BIOS interrupts Dos interrupts -mov -ready subroutines -add in bios -jmp -.....
Lets start by the features and draw-backs of the assembly language talking simple we can say.
[1]Features: a- Speed. b- Protection. c- i/o access. d- Size "it matters baby". [2]Draw-Backs: a- No 3d graphics. b- not good with math calculations. c- lack of documentation. Splitting "Assembly" = i) Debugger ii) Assembler
a) debugger --> for editing, No variables , No lables. types of debuggers --> gdb. soft-ice. periscope. .......... b) Assembler --> Nasm "http://www.cryogen.com/Nasm/". Tasm "http://home.comcast.net/~tasm/tasmdnl.htm". Masm "http://webster.cs.ucr.edu/AsmTools/MASM/".
LETS REALLY START
[3]Registers:- [i]General purpose registers: registers that can be divided into two equal parts of 8 bits each , each can be used individualy: AX --> accumulator register -- divided gives AL "low" ,AH "high". think of AX "int a =5;", which means that the register can hold a value. "EAX,AX,AH,AL" BX --> Base address register -- divided gives BL, BH. think of BX "char *add = 0x45", which means that BX is a pointer to memory address. "EBX,BX,BH,BL" CX --> Counter register -- divided gives CL,CH. think of CX "for(i = 0; i <= 10; i++);" which means that CX is used for loops. "ECX,CX,CH,CL" DX --> Data register -- divided gives DL, DH.It is used for I/O port access, arithmetic, some interrupt calls. "EDX,DX,DH,DL" [ii]Index Registers " cannot be divided": SI - Source index register DI - Destination index register these registeres are used to copy a block from a location to another. [iii]Segment registers "pointers that point to of 64k each":- DS - Data segment CS - Code segment --> used for instructions SS - Stack segment --> points to a stack segment ES - Extra segment
- Pointer Registers______________________________________
lets analyse line 1 : Mov BX,100 --> make BX point to memory address 100 line 2 : Mov AL,[BX] --> copy the content inside memory address 100 to the AL register line 3 : Mov BX,0 --> forget about 100 ;)
Some notes: F -->15 FF -->225 FFFF -->64k FFFFF -->1024 "1mb"
- Dos can only view memory not more than 1mb.
solution is to divide memory into 64k segments(16 segments each 64k), locations in memory are determined by: [i] Segment number , [ii] offset inside the segment.
- Segment number = its from 1 > 16
[4]Addressing modes:-
There are several type of addressing which we will talk about, we have : [a] immediate addressing, direct addressing, [c] indirect addressing{, [i] base addressing, base relative addressing, [ii] indexed addressing, relative indexed addressing, [iii] base indexed addressing, [iv]base indexed relative addressing}, [d] stack addressing. "OUCH"
- Immediate addressing: " addressing values to registers or memory"
wrong example: mov DS,3000 you cannot store in a Segment register. another wrong example: mov 30,AL 30 is not a register nor a address location. lets take a wrong example and solve it :) mov [30],5 "wrong wrong wrong" solution: first of all we must determine the format of 5 either a byte or a word in other words:- mov byte ptr [30],5 ----> this means that at 30"address" there is a pointer to a byte. mov word ptr [30],5 ----> this means that at 30"address" there is a pointer to a word. 5 = 05 byte ; 5 = 0005 word "2 bytes" correct example: mov ch,0 this doesnt affect the 0 flag register because this 0 stored in ch is not result of an operation in the ALU. the zero flag is affected by the results of operation executed in the alu only.
- Direct addressing:- "addressing values from one register to another"
- Indirect addressing:
- mov BX,3FCF
- mov [BX],AX
- mov [SI],DI
- mov cx,[DI]
- mov [SI+50],DX
- mov [SI],[SI+30]
[Edit this page] [Page history] [What links here] [Printer Friendly]
