Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

brian oslick

@brian oslick
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Coding Challenge
    B brian oslick

    Procedure.s TrimString(s1$,s2$)
    Protected fs
    while left(s1$,len(s2$))=s2$ or right(s1$,len(s2$))=s2$
    if left(s1$,len(s2$))=s2$
    s1$=right(s1$,len(s1$)-len(s2$))
    endif
    if right(s1$,len(s2$))=s2$
    s1$=left(s1$,len(s1$)-len(s2$))
    endif
    wend
    ProcedureReturn s1$
    EndProcedure

    ; cw() <- is short for consolewrite()

    s1$ ="dog cat monkey dog horse dog" ;<- dog on both ends
    s2$ ="dog"
    s1$ =TrimString(s1$,s2$)
    cw(s1$) ;>" cat monkey dog horse " ;<- 0x20 on both ends
    s2$ ="cat"
    s1$ =TrimString(s1$,s2$)
    cw(s1$) ;>" cat monkey dog horse " ;<- 0x20 on both ends

    ; Input string: "dog cat monkey dog horse dog"
    ; Strings that need to be trimmed from each end: { "dog", "cat" }

    ; Note: he says: 'Strings that need to be trimmed from each end'
    ; not that the Input string should be trimmed of 0x20

    ; that's probably obvious... but i thought i read a comment that
    ; the Input string should be trimmed of 0x20 (whitespaces)

    ; language PureBasic...

    The Lounge c++ architecture help

  • Coding Challenge
    B brian oslick

    Chris Maunder... without having to think too much (and thus stress my feeble brain)

    include 'win32a.inc'
    format PE console 4.0
    entry start
    ;*********************************************
    section '.data' data readable writeable

    _s db '%s',13,0

    i_string db 'dog cat monkey dog horse dog'
    o_string db 21 dup(0)

    ;*********************************************
    section '.text' code readable executable
    ;*********************************************
    start: ;fasm_dogcat.fasm

    mov ebx,3
    xor ecx,ecx
    above:
    mov eax,dword[i_string+ebx+ecx*4]
    mov dword[o_string+ecx*4],eax
    inc ecx
    cmp ecx,5
    jnz above
    mov ax,word[i_string+ebx+ecx*4]
    mov word[o_string+ecx*4],ax

    cinvoke printf,_s,o_string

    ; >"C:\_sys\temp\shell.exe"
    ;$20,'cat monkey dog horse',$20,0
    ; >Exit code: 0
    ;*********************************************
    invoke ExitProcess,0
    ;***********************************************
    section '.idata' data import readable writeable
    library kernel32,'kernel32.dll',\
    user32,'user32.dll',\
    msvcrt,'msvcrt.dll'
    include 'api\kernel32.inc'
    include 'api\user32.inc'
    import msvcrt,\
    printf,'printf'
    ;***********************************************

    brianO

    The Lounge c++ architecture help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups