.  253 f17  . 

⇒ Read "CODE" chapters 1-3
⇒ Download EMU 8086 software, install and register
Projects
0.WORKSHEET     1.TUTOR     (numbers)   (math)     2.FIBBY     3.CALC     4.MAZE     5.CFUNCS     6.TRAFFIC     7.BINARY   |   readability   reference
emu tutorials       emu help       emu instructions · intel instructions       emu8086.inc library · (source code)       emu sample code (local)       fizzbuzz
27RP1VRNDU1N8QXFRTQZXJKA   - use any name
42 class calendar
week 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
29 31 02 | 05 07 09 | 12 14 16 | 19 21 23 | 26 28 30 | 03 05 07 | 10 12 14 | 17 19 21 | 24 26 28 | 31 02 04 | 07 09 11 | 14 16 18 | 21 22 ** | 28 30 02 | 05 07 09
class 01 02 03 -- 04 05 06 07 08 09 10 11 12 13 -- 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 -- 37 38 39 40 41 42
 
Part I
a.   Class Intro, HW and Program Execution
syllabus and about 253
syllabus(pdf)/addendum(pdf), faq: grades, honesty, readable code, submit assignments, CAP, visual studio, labs on campus, macs
- Analyzing and solving problems -- Significant effort! - Need to READ! - I welcome questions & discussion, but individual conversations distract others and really bug me - If you miss class, it is YOUR responsibility to get missed material - I will take attendance - seating chart next class
YOU will be doing code like this: ASM Code and Mixed C++ and ASM Code Day One Quiz (C#)
Have an understanding of what the course is about and what is expected. representation, organization asm code architecture c / asm code integration
- About HW: where programs execute - emu Hardware - microsim: hardware - Bits, Bytes and Nybbles
b.   Number Bases: Unsigned Numbers in Base 2,8,10, 16
- Code In Paint - Base 2,8,10,16 and Unsigned Integers - emu: number systems - formula for n-bit unsigned binary number range: low to high, 0 to 2n - 1
c.   Signed Integers and IEEE 754 Floating Point
sign-magnitude one's complement Representing Signed Integers in "two's complement" notation formula for n-bit number range Representing Floating Point Numbers
d.   Character Data: ASCII, Unicode and UTF
e.   Using emu8086
f.   Instruction Codes, List Files
g.   Organization of CPU Registers and Memory
store and move data & information DB, DW, MOV, endian emu CODE with library procs and macros list file * put into emu8096 emulator * examine list file
h.   Assembly Language Intro: basic instructions, flags
assembly language intro arithmetic and logic instructions what is assembly & why the asembly process mov flags (C Z S O) add, sub,cmp, and, test, or, xor mul, imul, div, idiv inc, dec, not, neg truth tables XCHG, AND, OR, XOR, NOT Masks: (and, or, set, clear) & Architecture and, or / clear, set masks xor encrypt, decrypt, clear fast
i.   Flags, Compares, Jumps and Loops: Flow Control / Overflow!
loop review flags flow control: jmps overflow cmp jump masks see if set? jz jnz flags not set by mov emu debugger jz with ret label loop jmp
j.   Procedure Calls, Stack and Macros
Procedures Stacks emu: procedures emu: the stack MACRO simply expanded inline CALL IP points to NEXT instruction past Call IP Pushed on stack IP adjusted by offset which is included in instruction Execute Proc Ret pops stack into IP Isolate functionality Save and restore registers unless returning value pusha, popa
k.   Addressing Modes
16 bits => 1MB ?? magic? ea (effective address) = Segment x 16 + IP cs = 0700, ip = 010f ea = 07000 +010f 0710f there are 16 64k segments in the 1 megabyte address space of the 8086, emu: mov & memory access
  ∴   Test1 - Mid Term Exam: M() & W()
TEST 1 Review Create a CAP List Files Endian
Part II
l.   Pointers and Arrays
pointers and arrays loop and add WORDS in an array We want to sum a byte array and keep sum in ax. This won't work: x db 5,6,7,8 lea si, x add ax, byte ptr[si] ;!NO! size issue loop and add BYTES in an array -- documented (local)
m.   Maze Intro
Maze assignment symbol table ptr lea labels location counter
n.   Looping thru an Array of Bytes and Printing: Maze
maze intro maze loop drawMaze (local) cmp - sets zero flag jz, je jnz, nje pusha, popa asm in visual studio 2012
o.   Interrupts to Read and Write
interrupts read int 16h, ah=0 write int 10h ah= 9 or 0ah int 21h putc call print 8086 interrupt list
p.   DIV, MUL Use Multiple Registers | Magic?
q.   Mixed Code Intro
mixing high-level and low-level code mixed code example - simple look at my code: CPP_ASM C++ main printf scanf_s (safe) call c++ function includes inline asm call asm code calls C functions (printf, scanf) pass args to asm on stack mov esi, [esp+4] returns by reference in c++, C by reference via pointer c++: *p=999; asm: mov esi, p mov [esi], 999 by value - yes called asm: mov eax, 999 ; ** MUST BE EAX! ret caller c++: int x = asm_main(); // x will receive the 999 in eax
r.   Mixed Code: C++ and ASM
s.   Mixed C with ASM
t.   emu8086 MicroController: Devices
u.   MicroControllers & Microsim
v.   Architecture I, II, III
  ∴   Test 2 - Final Exam: Wednesdy at 8am and 10am
Student is responsible for notes, readings and classroom discussions.   Notes may be changed, emphasized, re-ordered or skipped over.


  SOFTWARE DOWNLOADS:   (all free)

1. emu8086 (free download: get license code from wyatt)

2. Visual Studio Express 2015 Community

3. microsim v5.0 (free download: get license code from wyatt)
TEXT(S) & READINGS:  

1. "Code" by Charles Petzold, Microsoft Press, 2000.   [required]
    (amazon)   ·   (bookstore)
2. On-line readings from emu8086: (free) [required]
      assembly tutorials       emu8086 reference       emu8086.inc library       emu8086 BUGS
      library source code       8086 instruction set       8086 interrupt list
      emu: about assembly language       using emu8086       emu8086 sample code
3. On-line readings from Microsim V5.0: (free) [required]
     Online Manual     Architecture: 256 bytes RAM     Using the Simulator
4. Software Developer Manuals from Intel [reference]
    Intel 80386 Reference Programmer's Manual   -   Intel micro-architecture