Cache Question

From: Bryan Parkoff (bryan.nospam.parkoff_at_nospam.com)
Date: 03/29/04


Date: Mon, 29 Mar 2004 03:01:08 +0000 (UTC)


    I understand that Cache L1 can only limit 8KB or 16KB. Is it really
8192 bytes or 16384 bytes? It looks like 64 bytes times 128 lines that it
equals to 8192 bytes. Does it mean that the length of instruction and index
/ displacement?

For example:

MOV [mem1],200 ; 10 bytes
MOV [mem2],200 ; 10 bytes
MOV [mem3],201 ; 10 bytes
MOV EAX,100 ; 5 bytes
MOV EBX,150 ; 5 bytes

Total: 40 bytes.

    Forty bytes can fit in Cache L1 that is 8KB. Twenty-four bytes are
unused, but they must be replaced to NOP. Forty bytes plus 24 NOPs are in
first line. Next more instructions with 64 byte count will be in second
line. Between first and second line are not cross boundary.
    If instructions have total 65 bytes, it won't fit in first line so it
has to fit in both first and second line that it can cause cross boundary
before it will have cache miss.
    Is it correct?

    What is difference between Cache L1 and L2?

-- 
Bryan Parkoff


Relevant Pages

  • Re: Cost of calling a standard library function
    ... instructions like "REP MOVSD" are simply like "on-chip macros"...that ... RISC-style instruction can execute just as well, ... RISC "MOV" instructions...that's why we're getting the speed ...
    (alt.lang.asm)
  • Multi-Statements Lines
    ... Therefore, i have developed and proposed a new Assembler, with ... Instructions are not isolated things, ... mov eax 0 ... a News Group that is supposed to address Assembly Programmers, ...
    (alt.lang.asm)
  • Re: RosAsm User Interface
    ... ; Generic console macros ... mov B§esi,al ... If some Instructions have, exceptionaly, to be commented, ... Divide eax by 10, make it a Digit, and store it. ...
    (alt.lang.asm)
  • Re: MOVZX has stall register
    ... | bits instructions and 16 bits instructions. ... | MOV BYTE PTR, ... | MOV EAX, 0FEH ... It can be done with Sign flag, Overflow flag, and Zero flag. ...
    (comp.lang.asm.x86)
  • Re: on reduce instruction lenght
    ... "mov eax, ebx" to ... push r1, r2, r3; ... map to all instructions, which will make any complete implementation ... the source download for my compiler does include the complete ...
    (alt.lang.asm)