World of Spectrum
  • Categories
  • Discussions
  • FAQ
  • Sign In
Home › Search
Title Search
@title beer Word 'beer' in title
User Search
  • @user admin Only posts by Admin
Text Search
  • @body beer Word 'beer' in the text
Phrase Search
"Hello World" Exact phrase match
Exclude Terms
  • car -red Search cars that are not red
"Or" Searches
  • honda | bmw 'honda' or 'bmw' results
Multi-Field
@(title,body) hello Both contain 'hello'
WildCard
  • hond* civ* Match all with an astrix
Combination
  • @title bmw @user admin
See more supported syntax examples
Search Again :: Adv Search 1000 results in 0.004s
<1234567…34>
  • Spin Assembler DirectivesLeading on from [URL="http://www.worldofspectrum.org/forums/showpost.php?p=402514&postcount=65"]jp's recent post in Spin 0.7 Public Testing thread[/U…

    ... :

    [code]
    (S: '(BC)'; I: 138), (S: '(C)'; I ... : 177),
    (S: 'BC'; I: 113),
    (S: 'BC'#39; I: 117 ... : 11+($FFEDB9 shl 8)), (S: 'CPI'; I: 12+($FFEDA1 shl 8 ...
    Dunny Dunny November 2009 Emulators
  • Spin Assembler DirectivesLeading on from [URL="http://www.worldofspectrum.org/forums/showpost.php?p=402514&postcount=65"]jp's recent post in Spin 0.7 Public Testing thread[/U…

    ... :

    [code]
    (S: '(BC)'; I: 138), (S: '(C)'; I ... : 177),
    (S: 'BC'; I: 113),
    (S: 'BC'#39; I: 117 ... : 11+($FFEDB9 shl 8)), (S: 'CPI'; I: 12+($FFEDA1 shl 8 ...
    jp jp November 2009 Emulators
  • Bit functions speedI just stared nonplussed at the documentation for the bit functions. Apparently, if you're using the accumulator, using AND and OR is faster than se…

    ... the use of CPI to test if BC is zero at the ... ]
    inc hl
    dec bc
    ld a,b

    [code]
    cpi
    jp pe, loop ; or ...
    Alcoholics Anonymous Alcoholics Anonymous February 2010 Development
  • FMV on +3eOK, so about 6 months ago i posted here that i got full motion video on +3e, with a bunch of scr files called passion. I added the glider rider music…

    ... ,table
    exx
    ld bc,49149
    exx
    ld ... bc,len

    loop:
    < ...
    jr nz,deloop
    cpi
    jp pe,loop
    omega omega April 2010 Development
  • Thinking in Assembly (first efforts)The following is one small routine to educate myself on a few concepts (jumps, flow control, routines, CPI): [code]searchmem xor a …

    ... ret po
    jr .search ; BC!=0
    ret ; not found ... /> push hl
    pop bc ; retrieve address
    ret< ... the entire memory
    .search cpi ; a-(HL)
    ret ...
    Einar Saukas Einar Saukas July 2011 Development
  • Kobrahsoft DB1 - doesn't work?Hi, I've tried loading [URL="http://www.worldofspectrum.org/infoseek.cgi?regexp=^DB1$&pub=^Kobrahsoft$&loadpics=3"]DB1 by Kobrahsoft[/URL] into two …

    ... BC_SPACES with zero in BC, attempting to make " ... 00 10
    LD BC, $0020 ; 8021 01 ... 00 C0
    LD BC, $1E3C ; 802B 01 ... HL ; 803E EB
    CPI ; 803F ED A1
    ...
    Battle Bunny Battle Bunny August 2011 Sinclair Miscellaneous
  • Fastest way to mirror a byte?I.E. turning 01100000 into 00000110, in assembly. I'm trying but I suck at stuff with rotation and the carry bit. Any pointers?

    ... CPD and repeat until BC=0.
    CPI Compare location (HL) and ... acc., incr HL, decr BC.
    CPIR Perform a CPI and repeat until BC=0.
    Ralf Ralf October 2011 Development
  • Asking for help: ZXBC to ASM routine translationHallo, In order to save some bytes and gain speed, I'm asking for translation of a very simple ZXBC routine to Assembler [code] sub light(x as uinteg…

    ... hl,hl
    add hl,bc
    end asm
    light1 ... ;'Counter for candles
    ld bc,418 ;'Counter for bytes to ... in level
    candles2:
    cpi
    jp po,candlesend
    pop bc ; B=y
    ex (sp ...
    LCD LCD November 2012 Development
  • Asking for help: ZXBC to ASM routine translationHallo, In order to save some bytes and gain speed, I'm asking for translation of a very simple ZXBC routine to Assembler [code] sub light(x as uinteg…

    ... ;'Counter for candles
    ld bc,418 ;'Counter for bytes to ... in level
    candles2:
    cpi
    jp po,candlesend
    ld bc,417 ;'Counter for bytes to ... in level
    candles2:
    cpi
    jr nz,candles3
    Einar Saukas Einar Saukas November 2012 Development
  • Machine code loopsDear all, 30 years too late I know, but I'm finally starting to get to grips with Machine Code - something I could never manage back in my early tee…

    ... you have,
    [code] ld bc,n_iterations
    .loop
    ;(some ... ;or dec hl
    dec bc
    ld a,b
    bc,n_iterations
    .loop
    ;(some kinda code)
    cpi ;or ...
    Hikaru Hikaru June 2013 Development
  • Machine code loopsDear all, 30 years too late I know, but I'm finally starting to get to grips with Machine Code - something I could never manage back in my early tee…

    ... ] ld bc,n_iterations
    .loop
    ;(some kinda code)
    cpi ;or ... such an ingenious use of CPI/CPD before. This is one ...
    TK90XFan TK90XFan June 2013 Development
  • Relocation with SDCCI desperately need auto- relocation with SDCC. Something that will compile all of my code using start address 0 and generate relocation table so that…

    ...
    pop hl
    pop bc
    pop de
    ex ... /> ; e = char c
    ; bc = size_t n

    ld ... ) ; remember current char
    cpi
    jr z, match ; ... match:

    dec hl ; cpi stepped hl one past last ...
    Alcoholics Anonymous Alcoholics Anonymous June 2013 Development
  • Experimenting with turboloadersHello, My first post, having lurked here for a while. I'm a lifelong computer nerd, Spectrum fan since childhood in the eighties, and have recently…

    ... if different
    dec bc ; decrement byte counter ( ... past byte)
    push bc ; save byte counter
    pop bc ; restore byte counter
    cpi ; advance ...
    stephenw32768 stephenw32768 August 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... addresses in HL: use the CPI instruction, which performs a comparison ... ), then increments HL and decrements BC. It's designed for scanning ... the P/V flag when BC reaches zero, so you can ... /> ld bc, 1024
    loop:
    ld (hl), 62
    cpi
    gasman gasman October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... /> ld bc, 1024
    loop:
    ld (hl), 62
    cpi
    ld hl, 16384
    ld bc, 1024
    ld d, 62 ... :
    ld (hl), d
    cpi
    jp pe, loop
    David Jones David Jones October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    [QUOTE] ld hl, 16384
    ld bc, 1024
    loop:
    ld (hl), 62
    cpi
    jp pe, loop
    ret[/QUOTE]

    Great trick!
    I've never used CPI in my life before.
    But I guess I'll be using it now :)
    Ralf Ralf October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... ld hl, 16384
    ld bc, 1024
    ld d, 62 ... /> ld (hl), d
    cpi
    jp pe, loop
    ld bc, #1024
    loop2:
    ldi ... /> jp pe, loop2 ; Test bc and loop
    ret
    u6c87 u6c87 October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... nice, both the use of CPI, and the tweaking above. At ... /> ld hl, #byte_to_write
    ld bc, #1024
    loop2:
    ldi ... "
    jp pe, loop2 ; Test bc and loop
    ret
    jamorski jamorski October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... that doesn't show DEC BC/LD A,B/OR C ... . Whats the point of exploiting CPI when you do not know ...
    catmeows catmeows October 2013 Development
  • Assembly - Loops bigger than 255Hi, It looks like it's a bit difficult to make loops with more than 255 cycles on Z80 machine code, since the 16-bit decrements (DEC) do not alter a…

    ... that doesn't show DEC BC/LD A,B/OR C ... . Whats the point of exploiting CPI when you do not know ...
    Arjun Arjun October 2013 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... ld hl,$stringstart
    ld bc,$bytes
    loop:
    cpi
    jp pe,loop
    ld bc,$bytes
    ld d,$ ... /> ld (hl),a
    cpi
    jp pe,loop
    Einar Saukas Einar Saukas January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... ld hl,StringAddress
    ld bc,StringLength
    .lp0
    ... /> ld (hl),a
    cpi
    jp pe,.lp0
    ld bc,StringLength
    .loop
    ... ld de,StringAddress
    ld bc,StringLength
    .lp0
    ...
    Hikaru Hikaru January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    This just sorta came up all of a sudden.

    [code]InPlaceV2
    ld hl,StringAddress
    ld bc,StringLength
    scf
    .loop
    rr (hl)
    jr nc,.loop
    cpi
    jp pe,.loop
    ret[/code]
    Hikaru Hikaru January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... /> ld hl,StringAddress
    ld bc,StringLength
    scf
    .loop ... )
    jr nc,.loop
    cpi
    jp pe,.loop
    Einar Saukas Einar Saukas January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... /> ld hl,StringAddress
    ld bc,StringLength
    scf
    .loop ... )
    jr nc,.loop
    cpi
    jp pe,.loop
    antoniovillena antoniovillena January 2014 Development
  • mirroring bitsIf I have a string of 1408 bytes, each of which has one bit 'b' set, what's the shortest way of mirroring that string, so that each bit set at positi…

    ... /> ld hl,StringAddress
    ld bc,StringLength
    scf
    .loop ... )
    jr nc,.loop
    cpi
    jp pe,.loop
    Dr BEEP Dr BEEP January 2014 Development
  • Pac-Land: can be coloured?All versions of this game are full coloured, but not the Spectrum version. It has large sprites, but maybe the scroll is too fine to make a coloured …

    ... ;attribute area
    LD BC,640 ;nr of chars < ... DE
    CPI ;INC HL,DEC BC no change DE
    BC=0

    DrawBottomAttr ... bottom part
    LD BC,160 ;nr of chars
    CPI ;INC HL,DEC BC no change DE
    Ralf Ralf February 2014 Games
  • LDI questionWhen using LDI (or LDD) is it possible to access the value that is transfered from (HL) to (DE), or does the Z80 use an internal data cache to store …

    ... .
    PF flag Set if BC not 0.
    SF, ZF ... 't work the same as CPI where the flags indicate if ... and Z flags like the CPI instruction does.
    Basher Basher March 2014 Development
  • Address bus contents (i.e. PC) during execution of HALTI'm wondering if anyone can tell me what's placed on the address bus during execution of HALT, beyond the initial M1 cycle. The Z80 user manual state…

    ... behaviour of the LDI and CPI instructions. As in this thread ... HL, the fifth is decrementing BC and PC.

    So ...
    Jonathan Harston Jonathan Harston March 2014 Hardware
  • LDI questionWhen using LDI (or LDD) is it possible to access the value that is transfered from (HL) to (DE), or does the Z80 use an internal data cache to store …

    ... s interesting that LDI and CPI both take 16 T-states ... as the CPI instruction isn't having to ... the final M cycle of CPI. My guess is that ... OR output byte to (BC)
    ?? decrement BC (or B)
    ...
    Now, where the decrement BC/B occurs I'm not ...
    Jonathan Harston Jonathan Harston March 2014 Development
<1234567…34>

Latest Posts

  • Your Favorite Magazine Cover Tapes.
    dm_boozefreek on 4:45PM
  • Happy 40th Birthday to the Amstrad CPC464!
    dmsmith on 4:10PM
  • "Late Entries"
    harriusherbartio on 4:00PM
  • How Do You Categorize Your Speccy Software and Games?
    harriusherbartio on 1:34PM
  • Simple Sprite Routine
    dmsmith on 1:25AM
  • I am currently watching.....
    zx1 on April 11
  • Today's BASIC program: visit attribute cells I am interested in, in pseudorandom order
    Paradigm Shifter on April 11
  • How do you share programs online?
    firelord on April 11
  • Celebrity deaths...
    Ælita on April 11
  • Who Has Got The Earliest ZX Spectrum Software?
    harriusherbartio on April 11

HitBox

Word Docs Hits
cpi 101 164
ldecrement 0 0
bc 3.6K 14K

Related Threads

  • BC 's Quest For Tireswhen playing this game you can only use keyboard right?.WRONG.if you press the letter "p" while the game has started(paused and waiting for input)a c…
  • BC Bill does this game work with a emulator?Can anyone get this game running with a emulator. I get as far as the main screen but can't start the game
  • BC BillThis is embarrassing but here goes...<br /> <br /> I'm playing BC Bill using ZX32. On the control menu I press 2 to select 'Kempston'. What do I need…
  • DEC BC/LD A,B/OR C/JP NZ,loopyesterday i saw nice trick:[code]<br /> <br /> dec bc<br /> ld a, b<br /> or c<br /> jp nz, loop<br /> <br /> can be replaced (bc starts &gt;255, sho…
  • Problems with BC bill gameI have loaded this game with several emulators and game files with the same result:<br /> you can choose the input -&gt; sinclair, kempston, etc but …
  • CPI emulationI'm currently writing Sinclairean's emulation assembly for the CPI/CPD/CPIR/CPDR instruction group. Does anybody know what exactly the behavior of th…
  • BC's Quest for Tires code sheet missingSpeaking of [URL="http://www.worldofspectrum.org/forums/showthread.php?t=35314"]missing code sheets[/URL], it appears the sheet for [URL="http://www.…
  • SBC IX,DE/BCAlways wondered why there wasn't a SBC IX, DE/BC command....<br /> <br /> so have to use<br /> <br /> PUSH HL ; save original HL<br /> PUSH IX ; …
  • Fuse tests - INC BC causes contention delayHi all,<br /> <br /> In the FUSE test suite it has the following for the output of opCode 0x3 (INC BC):<br /> <br /> 0 MC 0000<br /> 4 M…
  • Problem with BC corrupting after DJNZJust for fun, I'm messing around trying to get the level maps from Lemmings to display on the screen with machine code. It's been ages since I did an…

Related Searches

  • ld bc eostr string
  • call address in bc
  • print usr bc
  • bc bill
  • bc ill brown
  • bc bill brown
  • bc kid
  • usr bc register
  • usr bc register address
  • 14 bc b9
  • cpi
  • print bc assembler
  • ld bc hl
  • cpi copy
  • bc
  • ld bc 65533 a 254 out c
  • ld bc 65533
  • screen buffer push bc
  • cpi decrement bc
  • cpi ldecrement bc chris pile

Copyright © 2024 World of Spectrum